Feat: tools

This commit is contained in:
Grail Finder
2025-08-27 10:03:09 +03:00
parent 975183d684
commit 57b808cb31
3 changed files with 107 additions and 2 deletions

View File

@@ -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"`
}
// ===