Class CodeMieProvider.OpenAIProviderExtension
java.lang.Object
org.machanism.machai.process.provider.AbstractAIProvider
org.machanism.machai.genai.provider.OpenAIProvider
org.machanism.machai.genai.provider.CodeMieProvider.OpenAIProviderExtension
- All Implemented Interfaces:
EmbeddingProvider, ProcessProvider
- Enclosing class:
CodeMieProvider
OpenAI provider extension that refreshes the CodeMie access token.
- Since:
- 1.2.0
- Author:
- Viktor Tovstyi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringPassword or client secret supplied to the token endpoint.private final StringToken endpoint used to obtain the access token.private final StringUser name supplied to the CodeMie token endpoint.Fields inherited from class OpenAIProvider
inputs, logger, OPENAI_API_KEY, OPENAI_BASE_URL_NAME, toolMap -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOpenAIProviderExtension(String username, String resolvedAuthUrl, String password) Creates an OpenAI extension with the credentials used for token refresh. -
Method Summary
Modifier and TypeMethodDescriptioncom.openai.client.OpenAIClientRefreshes the access token and creates the configured OpenAI client.Methods inherited from class OpenAIProvider
addMcpServer, addTool, addWebSearch, captureUsage, clear, embedding, getToolNames, perform, promptMethods inherited from class AbstractAIProvider
addMcpServers, addPrompt, addPrompts, addResource, addResources, addTools, addWebSearch, getConfigurator, getInstructions, getMaxOutputTokens, getMaxToolCalls, getModel, getParamValue, getProjectDir, getTimeout, init, instructions, isErrorHandling, normalize, safelyInvokeTool, setErrorHandling, setInstructions, setMaxOutputTokens, setMaxToolCalls, setModel, setProjectDir, setTimeout, toSnakeCaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingProvider
init
-
Field Details
-
username
User name supplied to the CodeMie token endpoint. -
resolvedAuthUrl
Token endpoint used to obtain the access token. -
password
Password or client secret supplied to the token endpoint.
-
-
Constructor Details
-
OpenAIProviderExtension
-
-
Method Details
-
getClient
public com.openai.client.OpenAIClient getClient()Refreshes the access token and creates the configured OpenAI client.- Overrides:
getClientin classOpenAIProvider- Returns:
- OpenAI client
-