Skip to content

Commit

Permalink
[azopenai] Updates for 2024-07-01 (#23362)
Browse files Browse the repository at this point in the history
* Regenerated to accomodate the latest API version (2024-07-01-preview), which adds in new batching and file APIs.

* Updated help text for the function parameters.

* Tests were literally doing nothing and weren't needed - we create clients all over the place using all the constructors.

* Remove empty section.

* Upload files works, and the other routes related to it _should_ work. Still need to test some more.

* Fixing a bug where I didn't need to pass in a pointer anymore.

* Very basic test for batches. The timing of the API makes it hard for us to test normally.

* Updated to handle an anonymous type

* Using latest commit from PR.

* updates for merged spec.

* fixed generation

* removing orphaned model

* updated recordings

* skipping test

* reducing coverage until we can reenable file tests.

* added comment about workaround

* removing orphaned type

* updated changelog

---------

Co-authored-by: Richard Park <ripark@microsoft.com>
  • Loading branch information
glecaros and Richard Park authored Sep 10, 2024
1 parent 047056e commit cdf0177
Show file tree
Hide file tree
Showing 24 changed files with 2,664 additions and 410 deletions.
2 changes: 1 addition & 1 deletion eng/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"Name": "azopenai",
"CoverageGoal": 0.22
"CoverageGoal": 0.18
},
{
"Name": "ai/azopenaiassistants",
Expand Down
39 changes: 35 additions & 4 deletions sdk/ai/azopenai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
# Release History

## 0.6.2 (Unreleased)
## 0.6.2 (2024-09-10)

### Features Added

### Breaking Changes
- Added Batch and File APIs.

### Bugs Fixed
### Breaking Changes

### Other Changes
- FunctionDefinition.Parameters has been changed to take JSON instead of an object/map. You can set it using code
similar to this:

```go
parametersJSON, err := json.Marshal(map[string]any{
"required": []string{"location"},
"type": "object",
"properties": map[string]any{
"location": map[string]any{
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
},
})

if err != nil {
// TODO: Update the following line with your application specific error handling logic
log.Printf("ERROR: %s", err)
return
}

// and then, in ChatCompletionsOptions
opts := azopenai.ChatCompletionsOptions{
Functions: []azopenai.FunctionDefinition{
{
Name: to.Ptr("get_current_weather"),
Description: to.Ptr("Get the current weather in a given location"),
Parameters: parametersJSON,
},
},
}
```

## 0.6.1 (2024-08-14)

Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azopenai/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/ai/azopenai",
"Tag": "go/ai/azopenai_1784620173"
"Tag": "go/ai/azopenai_920fad77c4"
}
Loading

0 comments on commit cdf0177

Please sign in to comment.