1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package eta_llm_http
- import "encoding/json"
- type BaseResponse struct {
- Ret int `json:"ret"`
- Msg string `json:"msg"`
- Success bool `json:"success"`
- Data json.RawMessage `json:"data"`
- }
- // ChunkResponse 定义流式响应的结构体
- type ChunkResponse struct {
- ID string `json:"id"`
- Object string `json:"object"`
- Model string `json:"model"`
- Created int64 `json:"created"`
- Status *string `json:"status"`
- MessageType int `json:"message_type"`
- MessageID *string `json:"message_id"`
- IsRef bool `json:"is_ref"`
- Docs []string `json:"docs"`
- Choices []Choice `json:"choices"`
- }
- // Choice 定义选择的结构体
- type Choice struct {
- Delta Delta `json:"delta"`
- Role string `json:"role"`
- }
- // Delta 定义增量的结构体
- type Delta struct {
- Content string `json:"content"`
- ToolCalls []ToolCall `json:"tool_calls"`
- }
- // ToolCall 定义工具调用的结构体
- type ToolCall struct {
- ID string `json:"id"`
- Type string `json:"type"`
- Function Function `json:"function"`
- }
- // Function 定义函数的结构体
- type Function struct {
- Name string `json:"name"`
- Arguments json.RawMessage `json:"arguments"`
- }
|