You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`"@azure/openai/types"` is imported which adds Azure-specific definitions (e.g. `data_sources`) to the client types
176
178
- The `azureExtensionOptions` property has been replaced with the inner `data_sources` property.
177
179
- The `parameters` property has been added to wrap the parameters of the extension, which mirrors the schema of the Azure OpenAI service API.
178
180
- Camel case properties have been replaced with snake case properties.
@@ -447,14 +449,16 @@ Note that:
447
449
448
450
### Content filter
449
451
450
-
Content filter results are part of the chat completions response types in `OpenAIClient`. The following example shows how to access the content filter results.
452
+
Content filter results are part of the chat completions response types in `OpenAIClient`. However, `AzureOpenAI` does not have a direct equivalent to the `contentFilterResults` property in the `ChatCompletion.Choice` interface. The content filter results can be accessed by importing `"@azure/openai/types"` and accessing the `content_filter_results` property. The following example shows how to access the content filter results.
@@ -486,13 +490,11 @@ for (const choice of results.choices) {
486
490
}
487
491
```
488
492
489
-
However `AzureOpenAI` does not have a direct equivalent to the `contentFilterResults` property in the `ChatCompletion.Choice` interface. The content filter results can be accessed by casting the `results` object to `any` and accessing the `content_filter_results` property.
490
-
491
493
---
492
494
493
495
Note that:
494
496
- camel case properties have been replaced with snake case properties
495
-
- A cast to `any` is used to access the `content_filter_results` property because it is not part of the `ChatCompletion.Choice` interface, see the [Azure types](#azure-types) section for more information
497
+
- `"@azure/openai/types"` is imported which adds Azure-specific definitions (e.g. content_filter_results) to the client types, see the [Azure types](#azure-types) section for more information
496
498
497
499
## Comparing Types
498
500
@@ -556,7 +558,7 @@ The following table explores several type names from `@azure/openai` and shows t
556
558
557
559
## Azure types
558
560
559
-
`AzureOpenAI` connects to the Azure OpenAI service and can call all the operations available in the service. However, the types of the requests and responses are inherited from the `OpenAI` and are not yet updated to reflect the additional features supported exclusively by the Azure OpenAI service. TypeScript users will be required to cast to a more permissive type such as `Record<string, any>` to access those features. Examples in [the Migration examples](#migration-examples) section show how to do this.
561
+
`AzureOpenAI` connects to the Azure OpenAI service and can call all the operations available in the service. However, the types of the requests and responses are inherited from the `OpenAI` and are not yet updated to reflect the additional features supported exclusively by the Azure OpenAI service. TypeScript users will need to import `"@azure/openai/types"` from `@azure/openai@2.0.0-beta.1` which will merge Azure-specific definitions into existing types. Examples in [the Migration examples](#migration-examples) section show how to do this.
0 commit comments