ruff
This commit is contained in:
@@ -81,9 +81,9 @@ class GoogleLLMOpenAIBetaService(OpenAILLMService):
|
|||||||
|
|
||||||
await self.start_ttfb_metrics()
|
await self.start_ttfb_metrics()
|
||||||
|
|
||||||
chunk_stream: AsyncStream[ChatCompletionChunk] = await self._stream_chat_completions_specific_context(
|
chunk_stream: AsyncStream[
|
||||||
context
|
ChatCompletionChunk
|
||||||
)
|
] = await self._stream_chat_completions_specific_context(context)
|
||||||
|
|
||||||
async for chunk in chunk_stream:
|
async for chunk in chunk_stream:
|
||||||
if chunk.usage:
|
if chunk.usage:
|
||||||
|
|||||||
@@ -213,16 +213,15 @@ class BaseOpenAILLMService(LLMService):
|
|||||||
chunks = await self._client.chat.completions.create(**params)
|
chunks = await self._client.chat.completions.create(**params)
|
||||||
return chunks
|
return chunks
|
||||||
|
|
||||||
def build_chat_completion_params(
|
def build_chat_completion_params(self, params_from_context: OpenAILLMInvocationParams) -> dict:
|
||||||
self, params_from_context: OpenAILLMInvocationParams
|
|
||||||
) -> dict:
|
|
||||||
"""Build parameters for chat completion request.
|
"""Build parameters for chat completion request.
|
||||||
|
|
||||||
Subclasses can override this to customize parameters for different providers.
|
Subclasses can override this to customize parameters for different providers.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
context: The LLM context containing tools and configuration.
|
params_from_context: Parameters, derived from the LLM context, to
|
||||||
messages: List of chat completion messages to send.
|
use for the chat completion. Contains messages, tools, and tool
|
||||||
|
choice.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dictionary of parameters for the chat completion request.
|
Dictionary of parameters for the chat completion request.
|
||||||
|
|||||||
@@ -122,9 +122,9 @@ class SambaNovaLLMService(OpenAILLMService): # type: ignore
|
|||||||
|
|
||||||
await self.start_ttfb_metrics()
|
await self.start_ttfb_metrics()
|
||||||
|
|
||||||
chunk_stream: AsyncStream[ChatCompletionChunk] = await self._stream_chat_completions_specific_context(
|
chunk_stream: AsyncStream[
|
||||||
context
|
ChatCompletionChunk
|
||||||
)
|
] = await self._stream_chat_completions_specific_context(context)
|
||||||
|
|
||||||
async for chunk in chunk_stream:
|
async for chunk in chunk_stream:
|
||||||
if chunk.usage:
|
if chunk.usage:
|
||||||
|
|||||||
Reference in New Issue
Block a user