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
Copy file name to clipboardExpand all lines: docs/api/language_model_clients/AzureOpenAI.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,30 +29,32 @@ class AzureOpenAI(LM):
29
29
):
30
30
```
31
31
32
+
**Parameters:**
32
33
33
-
34
-
**Parameters:**
35
34
-`api_base` (str): Azure Base URL.
36
35
-`api_version` (str): Version identifier for Azure OpenAI API.
37
36
-`api_key` (_Optional[str]_, _optional_): API provider authentication token. Retrieves from `AZURE_OPENAI_KEY` environment variable if None.
38
37
-`model_type` (_Literal["chat", "text"]_): Specified model type to use, defaults to 'chat'.
38
+
-`azure_ad_token_provider` (_Optional[AzureADTokenProvider]_, _optional_): Pass the bearer token provider created by _get_bearer_token_provider()_ when using DefaultAzureCredential, alternative to api token.
39
39
-`**kwargs`: Additional language model arguments to pass to the API provider.
Retrieves completions from Azure OpenAI Endpoints by calling `request`.
45
+
Retrieves completions from Azure OpenAI Endpoints by calling `request`.
46
46
47
47
Internally, the method handles the specifics of preparing the request prompt and corresponding payload to obtain the response.
48
48
49
49
After generation, the completions are post-processed based on the `model_type` parameter. If the parameter is set to 'chat', the generated content look like `choice["message"]["content"]`. Otherwise, the generated text will be `choice["text"]`.
50
50
51
51
**Parameters:**
52
+
52
53
-`prompt` (_str_): Prompt to send to Azure OpenAI.
53
54
-`only_completed` (_bool_, _optional_): Flag to return only completed responses and ignore completion due to length. Defaults to True.
54
55
-`return_sorted` (_bool_, _optional_): Flag to sort the completion choices using the returned averaged log-probabilities. Defaults to False.
55
56
-`**kwargs`: Additional keyword arguments for completion request.
56
57
57
58
**Returns:**
59
+
58
60
-`List[Dict[str, Any]]`: List of completion choices.
0 commit comments