Improve handling of JSON Schema in OpenAI API Response Context (#819)

* feat: add jsonschema.Validate and jsonschema.Unmarshal

* fix Sanity check

* remove slices.Contains

* fix Sanity check

* add SchemaWrapper

* update api_integration_test.go

* update method 'reflectSchema' to support 'omitempty' in JSON tag

* add GenerateSchemaForType

* update json_test.go

* update `Warp` to `Wrap`

* fix Sanity check

* fix Sanity check

* update api_internal_test.go

* update README.md

* update README.md

* remove jsonschema.SchemaWrapper

* remove jsonschema.SchemaWrapper

* fix Sanity check

* optimize code formatting
This commit is contained in:
eiixy
2024-08-25 01:06:08 +08:00
committed by GitHub
parent 5162adbbf9
commit a3bd2569ac
7 changed files with 412 additions and 30 deletions

View File

@@ -59,7 +59,7 @@ func ExampleClient_CreateChatCompletionStream() {
}
defer stream.Close()
fmt.Printf("Stream response: ")
fmt.Print("Stream response: ")
for {
var response openai.ChatCompletionStreamResponse
response, err = stream.Recv()