Skip to content

Commit

Permalink
[azopenai] Removing the constants in functions example, they seem to …
Browse files Browse the repository at this point in the history
…confuse more than help. (#21218)

* Also, updated changelog release date to today
  • Loading branch information
richardpark-msft authored Jul 19, 2023
1 parent c1462e2 commit 49ba43c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion sdk/cognitiveservices/azopenai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Release History

## 0.1.0 (unreleased)
## 0.1.0 (2023-07-19)

* Initial release of the `azopenai` library
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ func ExampleClient_GetChatCompletions_functions() {
// TODO: handle error
}

// some JSON schema keys
const jsonSchemaType = "type"
const jsonSchemaDesc = "description"
const jsonSchemaEnum = "enum"
const jsonSchemaRequired = "required"
const jsonSchemaProps = "properties"

resp, err := client.GetChatCompletions(context.Background(), azopenai.ChatCompletionsOptions{
Model: &modelDeploymentID,
Messages: []azopenai.ChatMessage{
Expand All @@ -133,16 +126,16 @@ func ExampleClient_GetChatCompletions_functions() {
Description: to.Ptr("Get the current weather in a given location"),

Parameters: map[string]any{
jsonSchemaRequired: []string{"location"},
jsonSchemaType: "object",
jsonSchemaProps: map[string]any{
"required": []string{"location"},
"type": "object",
"properties": map[string]any{
"location": map[string]any{
jsonSchemaType: "string",
jsonSchemaDesc: "The city and state, e.g. San Francisco, CA",
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": map[string]any{
jsonSchemaType: "string",
jsonSchemaEnum: []string{"celsius", "fahrenheit"},
"type": "string",
"enum": []string{"celsius", "fahrenheit"},
},
},
},
Expand Down

0 comments on commit 49ba43c

Please sign in to comment.