Feat: tools
This commit is contained in:
@@ -85,3 +85,44 @@ type RPMessage struct {
|
||||
Author string `json:"author"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// === tools models
|
||||
|
||||
type ToolArgProps struct {
|
||||
Type string `json:"type"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type ToolFuncParams struct {
|
||||
Type string `json:"type"`
|
||||
Properties map[string]ToolArgProps `json:"properties"`
|
||||
Required []string `json:"required"`
|
||||
}
|
||||
|
||||
type ToolFunc struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Parameters ToolFuncParams `json:"parameters"`
|
||||
}
|
||||
|
||||
type Tool struct {
|
||||
Type string `json:"type"`
|
||||
Function ToolFunc `json:"function"`
|
||||
}
|
||||
|
||||
type OpenAIReq struct {
|
||||
*ChatBody
|
||||
Tools []Tool `json:"tools"`
|
||||
}
|
||||
|
||||
type ChatBody struct {
|
||||
Model string `json:"model"`
|
||||
Messages []RoleMsg `json:"messages"`
|
||||
}
|
||||
|
||||
type RoleMsg struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// ===
|
||||
|
Reference in New Issue
Block a user