feat: 完善函数计费

This commit is contained in:
CaIon
2024-04-23 23:01:06 +08:00
parent 89ebd85503
commit 2841669246
8 changed files with 65 additions and 8 deletions

View File

@@ -32,6 +32,17 @@ type GeneralOpenAIRequest struct {
TopLogProbs int `json:"top_logprobs,omitempty"`
}
type OpenAITools struct {
Type string `json:"type"`
Function OpenAIFunction `json:"function"`
}
type OpenAIFunction struct {
Description string `json:"description,omitempty"`
Name string `json:"name"`
Parameters any `json:"parameters,omitempty"`
}
func (r GeneralOpenAIRequest) ParseInput() []string {
if r.Input == nil {
return nil