morpheus.llm.services.openai_chat_service.OpenAIChatService

class OpenAIChatService(*, default_model_kwargs=None)[source]

Bases: morpheus.llm.services.llm_service.LLMService

A service for interacting with OpenAI Chat models, this class should be used to create clients.

Methods

get_client(*, model_name[, set_assistant, ...]) Returns a client for interacting with a specific model.
get_client(*, model_name, set_assistant=False, max_retries=10, **model_kwargs)[source]

Returns a client for interacting with a specific model. This method is the preferred way to create a client.

Parameters
model_name

The name of the model to create a client for.

set_assistant: bool, optional default=False

When True, a second input field named assistant will be used to proide additional context to the model.

max_retries: int, optional default=10

The maximum number of retries to attempt when making a request to the OpenAI API.

model_kwargs

Additional keyword arguments to pass to the model when generating text. Arguments specified here will overwrite the default_model_kwargs set in the service constructor

Previous morpheus.llm.services.openai_chat_service.OpenAIChatClient
Next morpheus.llm.task_handlers
© Copyright 2024, NVIDIA. Last updated on Apr 25, 2024.