-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
P0Task with high level priorityTask with high level prioritybugSomething isn't workingSomething isn't workingcall for contribution
Milestone
Description
The tools function is not implemented, resulting in the inability to call tools using azure_openai_model.
`
def _run(
self,
messages: List[OpenAIMessage],
response_format: Optional[Type[BaseModel]] = None,
tools: Optional[List[Dict[str, Any]]] = None,
) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
r"""Runs inference of Azure OpenAI chat completion.
Args:
messages (List[OpenAIMessage]): Message list with the chat history
in OpenAI API format.
Returns:
Union[ChatCompletion, Stream[ChatCompletionChunk]]:
`ChatCompletion` in the non-stream mode, or
`Stream[ChatCompletionChunk]` in the stream mode.
"""
response = self._client.chat.completions.create(
messages=messages,
model=self.azure_deployment_name, # type:ignore[arg-type]
**self.model_config_dict,
)
return response
async def _arun(
self,
messages: List[OpenAIMessage],
response_format: Optional[Type[BaseModel]] = None,
tools: Optional[List[Dict[str, Any]]] = None,
) -> Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
r"""Runs inference of Azure OpenAI chat completion.
Args:
messages (List[OpenAIMessage]): Message list with the chat history
in OpenAI API format.
Returns:
Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
`ChatCompletion` in the non-stream mode, or
`AsyncStream[ChatCompletionChunk]` in the stream mode.
"""
response = await self._async_client.chat.completions.create(
messages=messages,
model=self.azure_deployment_name, # type:ignore[arg-type]
**self.model_config_dict,
)
return response`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Task with high level priorityTask with high level prioritybugSomething isn't workingSomething isn't workingcall for contribution
Type
Projects
Status
No status