adk-java icon indicating copy to clipboard operation
adk-java copied to clipboard

Feature request: Supports OpenAI compatible model

Open x3bits opened this issue 1 year ago • 9 comments

Currently, only Gemini and Claude are supported.

x3bits avatar May 23 '25 08:05 x3bits

We are evaluating a few options, but if you are interested contributing an initial draft, please take a look at https://github.com/google/adk-java/blob/main/contrib/README.md

cornellgit avatar May 24 '25 03:05 cornellgit

@x3bits https://github.com/google/adk-java/pull/102/ might be one solution A better solution is similar to the AntropicModel, create an OpenAIModel.java

cornellgit avatar May 24 '25 03:05 cornellgit

@x3bits #102 might be one solution A better solution is similar to the AntropicModel, create an OpenAIModel.java

@cornellgit Thanks very much. I changed the AntropicModel to OpenAIModel and it works. It's really a good solution.

x3bits avatar May 24 '25 09:05 x3bits

OAI models are quite useful, if you have a working copy, please feel free to merge into contrib/ @x3bits It may help as an example to how to do "Bring Your Own Model"

cornellgit avatar May 24 '25 20:05 cornellgit

Are there any updates on this issue by any chance? If not, I would like to contribute

DreamerChaserHAH avatar May 29 '25 06:05 DreamerChaserHAH

@DreamerChaserHAH feel free to submit PRs, happy to iterate on this. One ask is to use okhttp, I think it's already part of their official SDK.

cornellgit avatar May 29 '25 06:05 cornellgit

I'm really looking forward to this feature. @x3bits Could you share a sample code?

TomorJM avatar May 29 '25 09:05 TomorJM

I'm really looking forward to this feature. @x3bits Could you share a sample code?

https://github.com/google/adk-java/pull/102/commits/ea9223c7a09e79890a0728149e8e5a056403efba

Here is the sample code. Just change the AnthropicChatModel in the test code to OpenAiModel, and it will work.

x3bits avatar Jun 03 '25 10:06 x3bits

@x3bits this is now available via the LangChain4j connector in contrib/ - have you seen and tried it out?

I'll mark this issue as pending your feedback. We'll close it if we don't hear back from you within ~1 month.

vorburger avatar Aug 25 '25 17:08 vorburger