Class OpenAIProvider

java.lang.Object
org.machanism.machai.ai.openAI.OpenAIProvider
All Implemented Interfaces:
GenAIProvider

public class OpenAIProvider extends Object implements GenAIProvider
The `OpenAIProvider` class integrates seamlessly with the OpenAI API, serving as a concrete implementation of the `GenAIProvider` interface. This provider enables a wide range of generative AI capabilities, including: - Sending prompts and receiving responses from OpenAI Chat models. - Managing files for use in various OpenAI workflows. - Performing advanced large language model (LLM) requests, such as text generation, summarization, and question answering. - Creating and utilizing vector embeddings for tasks like semantic search and similarity analysis. By abstracting the complexities of direct API interaction, `OpenAIProvider` allows developers to leverage OpenAI’s powerful models efficiently within their applications. It supports both synchronous and asynchronous operations, and can be easily extended or configured to accommodate different use cases and model parameters.

This class provides capabilities to send prompts, manage files, perform LLM requests, and create embeddings using OpenAI Chat models.

Usage example:

 GenAIProvider provider = GenAIProviderManager.getProvider("OpenAI:gpt-5.1");
 
Thread safety: This implementation is NOT thread-safe.

Since:
0.0.2
Author:
Viktor Tovstyi