From 89b63ca96fa35cb3cef5aaf254e5c755abd2755e Mon Sep 17 00:00:00 2001 From: majian <46617237@qq.com> Date: Sat, 21 Sep 2024 22:35:24 +0800 Subject: [PATCH] feat: ResponseFormat support json_schema (#1759) * feat: responseFormat support json_schema * chore: rename struct name --------- Co-authored-by: JustSong --- relay/model/general.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/relay/model/general.go b/relay/model/general.go index c34c1c2d..aacc8467 100644 --- a/relay/model/general.go +++ b/relay/model/general.go @@ -1,7 +1,15 @@ package model type ResponseFormat struct { - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` + JsonSchema *JSONSchema `json:"json_schema,omitempty"` +} + +type JSONSchema struct { + Description string `json:"description,omitempty"` + Name string `json:"name"` + Schema map[string]interface{} `json:"schema,omitempty"` + Strict *bool `json:"strict,omitempty"` } type GeneralOpenAIRequest struct {