dllmforge.openai_api

Classes

OpenAIAPI([api_key, api_base, api_version, ...])

Class to interact with Azure OpenAI API.

class dllmforge.openai_api.OpenAIAPI(api_key=None, api_base=None, api_version=None, deployment_name='gpt-4o', embedding_deployment='text-embedding-3-large')[source]

Class to interact with Azure OpenAI API.

Initialize the OpenAI API client with Azure configuration.

__init__(api_key=None, api_base=None, api_version=None, deployment_name='gpt-4o', embedding_deployment='text-embedding-3-large')[source]

Initialize the OpenAI API client with Azure configuration.

check_server_status()[source]

Check if the Azure OpenAI service is accessible.

list_available_models()[source]

List available models from Azure OpenAI.

send_test_message(prompt='Hello, how are you?')[source]

Send a test message to the model and get a response.

get_embeddings(text)[source]

Get embeddings for the given text using Azure OpenAI.

chat_completion(messages, temperature=0.7, max_tokens=800)[source]

Get a chat completion from the model.