merge upstream and fix conflicts

This commit is contained in:
likelovewant
2024-12-12 13:17:55 +08:00
parent a0caaa2bc8
commit a64347c6d4
383 changed files with 59815 additions and 43978 deletions

View File

@@ -67,7 +67,7 @@ type ResponseFormat struct {
}
type JsonSchema struct {
Schema map[string]any `json:"schema"`
Schema json.RawMessage `json:"schema"`
}
type EmbedRequest struct {
@@ -495,11 +495,7 @@ func fromChatRequest(r ChatCompletionRequest) (*api.ChatRequest, error) {
format = json.RawMessage(`"json"`)
case "json_schema":
if r.ResponseFormat.JsonSchema != nil {
schema, err := json.Marshal(r.ResponseFormat.JsonSchema.Schema)
if err != nil {
return nil, fmt.Errorf("failed to marshal json schema: %w", err)
}
format = schema
format = r.ResponseFormat.JsonSchema.Schema
}
}
}