Interface OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
- All Superinterfaces:
org.apache.camel.builder.EndpointProducerBuilder,org.apache.camel.EndpointProducerResolver
- Enclosing interface:
OpenAIEndpointBuilderFactory
public static interface OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder
extends org.apache.camel.builder.EndpointProducerBuilder
Builder for endpoint for the OpenAI component.
-
Method Summary
Modifier and TypeMethodDescriptionadditionalBodyProperty(String key, Object value) Additional JSON properties to include in the request body (e.g.additionalBodyProperty(Map values) Additional JSON properties to include in the request body (e.g.advanced()OpenAI API key.Base URL for OpenAI API.conversationHistoryProperty(String conversationHistoryProperty) Exchange property name for storing conversation history.conversationMemory(boolean conversationMemory) Enable conversation memory per Exchange.conversationMemory(String conversationMemory) Enable conversation memory per Exchange.developerMessage(String developerMessage) Developer message to prepend before user messages.dimensions(Integer dimensions) Number of dimensions for the embedding output.dimensions(String dimensions) Number of dimensions for the embedding output.embeddingModel(String embeddingModel) The model to use for embeddings.encodingFormat(String encodingFormat) The format for embedding output: 'float' for list of floats, 'base64' for compressed format.jsonSchema(String jsonSchema) JSON schema for structured output validation.Maximum number of tokens to generate.Maximum number of tokens to generate.The model to use for chat completion.outputClass(String outputClass) Fully qualified class name for structured output using response format.storeFullResponse(boolean storeFullResponse) Store the full response in the exchange property 'CamelOpenAIResponse' in non-streaming mode.storeFullResponse(String storeFullResponse) Store the full response in the exchange property 'CamelOpenAIResponse' in non-streaming mode.streaming(boolean streaming) Enable streaming responses.Enable streaming responses.systemMessage(String systemMessage) System message to prepend.temperature(Double temperature) Temperature for response generation (0.0 to 2.0).temperature(String temperature) Temperature for response generation (0.0 to 2.0).Top P for response generation (0.0 to 1.0).Top P for response generation (0.0 to 1.0).userMessage(String userMessage) Default user message text to use when no prompt is provided.Methods inherited from interface org.apache.camel.builder.EndpointProducerBuilder
doSetMultiValueProperties, doSetMultiValueProperty, doSetProperty, expr, getRawUriMethods inherited from interface org.apache.camel.EndpointProducerResolver
resolve, resolve
-
Method Details
-
advanced
-
additionalBodyProperty
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder additionalBodyProperty(String key, Object value) Additional JSON properties to include in the request body (e.g. additionalBodyProperty.traceId=123). This is a multi-value option with prefix: additionalBodyProperty. The option is a:java.util.Map<java.lang.String, java.lang.Object>type. The option is multivalued, and you can use the additionalBodyProperty(String, Object) method to add a value (call the method multiple times to set more values). Group: producer- Parameters:
key- the option keyvalue- the option value- Returns:
- the dsl builder
-
additionalBodyProperty
Additional JSON properties to include in the request body (e.g. additionalBodyProperty.traceId=123). This is a multi-value option with prefix: additionalBodyProperty. The option is a:java.util.Map<java.lang.String, java.lang.Object>type. The option is multivalued, and you can use the additionalBodyProperty(String, Object) method to add a value (call the method multiple times to set more values). Group: producer- Parameters:
values- the values- Returns:
- the dsl builder
-
apiKey
OpenAI API key. Can also be set via OPENAI_API_KEY environment variable. The option is a:java.lang.Stringtype. Group: producer- Parameters:
apiKey- the value to set- Returns:
- the dsl builder
-
baseUrl
Base URL for OpenAI API. Defaults to OpenAI's official endpoint. Can be used for local or third-party providers. The option is a:java.lang.Stringtype. Default: https://api.openai.com/v1 Group: producer- Parameters:
baseUrl- the value to set- Returns:
- the dsl builder
-
conversationHistoryProperty
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder conversationHistoryProperty(String conversationHistoryProperty) Exchange property name for storing conversation history. The option is a:java.lang.Stringtype. Default: CamelOpenAIConversationHistory Group: producer- Parameters:
conversationHistoryProperty- the value to set- Returns:
- the dsl builder
-
conversationMemory
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder conversationMemory(boolean conversationMemory) Enable conversation memory per Exchange. The option is a:booleantype. Default: false Group: producer- Parameters:
conversationMemory- the value to set- Returns:
- the dsl builder
-
conversationMemory
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder conversationMemory(String conversationMemory) Enable conversation memory per Exchange. The option will be converted to abooleantype. Default: false Group: producer- Parameters:
conversationMemory- the value to set- Returns:
- the dsl builder
-
developerMessage
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder developerMessage(String developerMessage) Developer message to prepend before user messages. The option is a:java.lang.Stringtype. Group: producer- Parameters:
developerMessage- the value to set- Returns:
- the dsl builder
-
dimensions
Number of dimensions for the embedding output. Only supported by text-embedding-3 models. Reducing dimensions can lower costs and improve performance without significant quality loss. The option is a:java.lang.Integertype. Group: producer- Parameters:
dimensions- the value to set- Returns:
- the dsl builder
-
dimensions
Number of dimensions for the embedding output. Only supported by text-embedding-3 models. Reducing dimensions can lower costs and improve performance without significant quality loss. The option will be converted to ajava.lang.Integertype. Group: producer- Parameters:
dimensions- the value to set- Returns:
- the dsl builder
-
embeddingModel
The model to use for embeddings. The option is a:java.lang.Stringtype. Group: producer- Parameters:
embeddingModel- the value to set- Returns:
- the dsl builder
-
encodingFormat
The format for embedding output: 'float' for list of floats, 'base64' for compressed format. The option is a:java.lang.Stringtype. Default: base64 Group: producer- Parameters:
encodingFormat- the value to set- Returns:
- the dsl builder
-
jsonSchema
JSON schema for structured output validation. This option can also be loaded from an existing file, by prefixing with file: or classpath: followed by the location of the file. The option is a:java.lang.Stringtype. Group: producer- Parameters:
jsonSchema- the value to set- Returns:
- the dsl builder
-
maxTokens
Maximum number of tokens to generate. The option is a:java.lang.Integertype. Group: producer- Parameters:
maxTokens- the value to set- Returns:
- the dsl builder
-
maxTokens
Maximum number of tokens to generate. The option will be converted to ajava.lang.Integertype. Group: producer- Parameters:
maxTokens- the value to set- Returns:
- the dsl builder
-
model
The model to use for chat completion. The option is a:java.lang.Stringtype. Group: producer- Parameters:
model- the value to set- Returns:
- the dsl builder
-
outputClass
Fully qualified class name for structured output using response format. The option is a:java.lang.Stringtype. Group: producer- Parameters:
outputClass- the value to set- Returns:
- the dsl builder
-
storeFullResponse
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder storeFullResponse(boolean storeFullResponse) Store the full response in the exchange property 'CamelOpenAIResponse' in non-streaming mode. The option is a:booleantype. Default: false Group: producer- Parameters:
storeFullResponse- the value to set- Returns:
- the dsl builder
-
storeFullResponse
default OpenAIEndpointBuilderFactory.OpenAIEndpointBuilder storeFullResponse(String storeFullResponse) Store the full response in the exchange property 'CamelOpenAIResponse' in non-streaming mode. The option will be converted to abooleantype. Default: false Group: producer- Parameters:
storeFullResponse- the value to set- Returns:
- the dsl builder
-
streaming
Enable streaming responses. The option is a:booleantype. Default: false Group: producer- Parameters:
streaming- the value to set- Returns:
- the dsl builder
-
streaming
Enable streaming responses. The option will be converted to abooleantype. Default: false Group: producer- Parameters:
streaming- the value to set- Returns:
- the dsl builder
-
systemMessage
System message to prepend. When set and conversationMemory is enabled, the conversation history is reset. The option is a:java.lang.Stringtype. Group: producer- Parameters:
systemMessage- the value to set- Returns:
- the dsl builder
-
temperature
Temperature for response generation (0.0 to 2.0). The option is a:java.lang.Doubletype. Group: producer- Parameters:
temperature- the value to set- Returns:
- the dsl builder
-
temperature
Temperature for response generation (0.0 to 2.0). The option will be converted to ajava.lang.Doubletype. Group: producer- Parameters:
temperature- the value to set- Returns:
- the dsl builder
-
topP
Top P for response generation (0.0 to 1.0). The option is a:java.lang.Doubletype. Group: producer- Parameters:
topP- the value to set- Returns:
- the dsl builder
-
topP
Top P for response generation (0.0 to 1.0). The option will be converted to ajava.lang.Doubletype. Group: producer- Parameters:
topP- the value to set- Returns:
- the dsl builder
-
userMessage
Default user message text to use when no prompt is provided. The option is a:java.lang.Stringtype. Group: producer- Parameters:
userMessage- the value to set- Returns:
- the dsl builder
-