github Azure/azure-sdk-for-go sdk/ai/azopenai/v0.6.2

latest releases: sdk/security/keyvault/azcertificates/v1.3.0, sdk/security/keyvault/azkeys/v1.3.0, sdk/security/keyvault/azsecrets/v1.3.0...
pre-releaseone month ago

0.6.2 (2024-09-10)

Features Added

  • Added Batch and File APIs.

Breaking Changes

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

      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,
          },
        },
      }

Don't miss a new azure-sdk-for-go release

NewReleases is sending notifications on new releases.