mirror of
https://github.com/coaidev/coai.git
synced 2025-05-20 05:20:15 +09:00
29 lines
935 B
Go
29 lines
935 B
Go
package globals
|
|
|
|
type Hook func(data string) error
|
|
type Message struct {
|
|
Role string `json:"role"`
|
|
Content string `json:"content"`
|
|
Name *string `json:"name,omitempty"`
|
|
FunctionCall *FunctionCall `json:"function_call,omitempty"` // only `function` role
|
|
ToolCallId *string `json:"tool_call_id,omitempty"` // only `tool` role
|
|
ToolCalls *ToolCalls `json:"tool_calls,omitempty"` // only `assistant` role
|
|
}
|
|
|
|
type ChatSegmentResponse struct {
|
|
Conversation int64 `json:"conversation"`
|
|
Quota float32 `json:"quota"`
|
|
Keyword string `json:"keyword"`
|
|
Message string `json:"message"`
|
|
End bool `json:"end"`
|
|
Plan bool `json:"plan"`
|
|
}
|
|
|
|
type GenerationSegmentResponse struct {
|
|
Quota float32 `json:"quota"`
|
|
Message string `json:"message"`
|
|
Hash string `json:"hash"`
|
|
End bool `json:"end"`
|
|
Error string `json:"error"`
|
|
}
|