You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched in the issues and found nothing similar.
Description
Motivation
Python has OpenAIEmbeddingModelConnection and OpenAIEmbeddingModelSetup; Java has only Ollama and Bedrock. A Java agent that needs an OpenAI embedding today must go through the Python wrapper, which requires a Python environment on the task managers for a plain HTTPS call. This is a Java/Python parity gap. The Java OpenAI chat model already depends on com.openai:openai-java, so no new third-party dependency is needed.
Proposed changes
New module integrations/embedding-models/openai with OpenAIEmbeddingModelConnection and OpenAIEmbeddingModelSetup, built the same way OpenAICompletionsConnection builds its client.
Arguments mirror the Python classes one for one: connection api_key, base_url, request_timeout, max_retries, organization, project; setup connection, model, encoding_format, dimensions, user, additional_kwargs.
ResourceName constants, YAML aliases, dist registration, and a Java tab in the OpenAI section of embedding_models.md.
Unit tests with a mocked client, following BedrockEmbeddingModelTest.
One naming question: the Java OpenAI chat connection uses api_base_url and timeout, while the Python embedding connection uses base_url and request_timeout. I propose the Python embedding names so the two embedding implementations align across languages. Happy to follow the chat-model names instead if preferred.
Search before asking
Description
Motivation
Python has
OpenAIEmbeddingModelConnectionandOpenAIEmbeddingModelSetup; Java has only Ollama and Bedrock. A Java agent that needs an OpenAI embedding today must go through the Python wrapper, which requires a Python environment on the task managers for a plain HTTPS call. This is a Java/Python parity gap. The Java OpenAI chat model already depends oncom.openai:openai-java, so no new third-party dependency is needed.Proposed changes
integrations/embedding-models/openaiwithOpenAIEmbeddingModelConnectionandOpenAIEmbeddingModelSetup, built the same wayOpenAICompletionsConnectionbuilds its client.api_key,base_url,request_timeout,max_retries,organization,project; setupconnection,model,encoding_format,dimensions,user,additional_kwargs.embedWithUsagereports prompt and total tokens so the embedding token metrics from [api][python][java] Track embedding token usage metrics #870 cover this provider.ResourceNameconstants, YAML aliases,distregistration, and a Java tab in the OpenAI section ofembedding_models.md.BedrockEmbeddingModelTest.One naming question: the Java OpenAI chat connection uses
api_base_urlandtimeout, while the Python embedding connection usesbase_urlandrequest_timeout. I propose the Python embedding names so the two embedding implementations align across languages. Happy to follow the chat-model names instead if preferred.Are you willing to submit a PR?