- 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
- set_assistant: bool, optional default=False
- max_retries: int, optional default=10
- model_kwargs
The name of the model to create a client for.
When
True
, a second input field namedassistant
will be used to proide additional context to the model.The maximum number of retries to attempt when making a request to the OpenAI API.
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
morpheus.llm.services.openai_chat_service.OpenAIChatService
Previous
morpheus.llm.services.openai_chat_service.OpenAIChatClient
Next
morpheus.llm.task_handlers