mirror of
https://github.com/coaidev/coai.git
synced 2025-05-23 23:10:13 +09:00
fix: remove role in relay stream response
This commit is contained in:
parent
e14fb02fb9
commit
104b5d3aac
@ -165,8 +165,7 @@ func getStreamTranshipmentForm(id string, created int64, form RelayForm, data *g
|
|||||||
Choices: []ChoiceDelta{
|
Choices: []ChoiceDelta{
|
||||||
{
|
{
|
||||||
Index: 0,
|
Index: 0,
|
||||||
Delta: globals.Message{
|
Delta: Message{
|
||||||
Role: globals.Assistant,
|
|
||||||
Content: data.Content,
|
Content: data.Content,
|
||||||
ToolCalls: data.ToolCall,
|
ToolCalls: data.ToolCall,
|
||||||
FunctionCall: data.FunctionCall,
|
FunctionCall: data.FunctionCall,
|
||||||
|
@ -50,6 +50,15 @@ type Choice struct {
|
|||||||
FinishReason string `json:"finish_reason"`
|
FinishReason string `json:"finish_reason"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StreamMessage struct {
|
||||||
|
Role *string `json:"role"`
|
||||||
|
Content string `json:"content"`
|
||||||
|
Name *string `json:"name,omitempty"`
|
||||||
|
FunctionCall *globals.FunctionCall `json:"function_call,omitempty"` // only `function` role
|
||||||
|
ToolCallId *string `json:"tool_call_id,omitempty"` // only `tool` role
|
||||||
|
ToolCalls *globals.ToolCalls `json:"tool_calls,omitempty"` // only `assistant` role
|
||||||
|
}
|
||||||
|
|
||||||
type Usage struct {
|
type Usage struct {
|
||||||
PromptTokens int `json:"prompt_tokens"`
|
PromptTokens int `json:"prompt_tokens"`
|
||||||
CompletionTokens int `json:"completion_tokens"`
|
CompletionTokens int `json:"completion_tokens"`
|
||||||
@ -68,7 +77,7 @@ type RelayResponse struct {
|
|||||||
|
|
||||||
type ChoiceDelta struct {
|
type ChoiceDelta struct {
|
||||||
Index int `json:"index"`
|
Index int `json:"index"`
|
||||||
Delta globals.Message `json:"delta"`
|
Delta Message `json:"delta"`
|
||||||
FinishReason interface{} `json:"finish_reason"`
|
FinishReason interface{} `json:"finish_reason"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user