-
Notifications
You must be signed in to change notification settings - Fork 76
[Feature][Java] Add OpenAI chat model integration #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@xli1996 Please add the following content to your PR description and select a checkbox: |
wenjin272
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @xli1996 , thanks for your contribution. Overall looks good to me. I left some minor comments.
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Outdated
Show resolved
Hide resolved
lihaosky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Xiang!
|
|
||
| Map<String, Object> paramSchema = getParamSchema(param); | ||
| paramSchema.put("description", paramDescription); | ||
| if (paramDescription != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be null? Looks getParamSchema at least returns Map<String, Object> paramSchema = new HashMap<>();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hit the issue when my Tool annotation has no description, seems it just skip
if (!toolParam.description().isEmpty()) {
paramDescription = toolParam.description();
}
and stay null, maybe we can just remove if (!toolParam.description().isEmpty()) {
|
@wenjin272 @lihaosky Thanks for the review, can you take another look, I have addressed some comments. |
...n/java/org/apache/flink/agents/integrations/chatmodels/openai/OpenAIChatModelConnection.java
Show resolved
Hide resolved
|
LGTM. Please take a look at your convenience @xintongsong |
|
@xli1996
|
# Conflicts: # e2e-test/flink-agents-end-to-end-tests-integration/src/test/java/org/apache/flink/agents/integration/test/AgentWithOpenAI.java # e2e-test/flink-agents-end-to-end-tests-integration/src/test/java/org/apache/flink/agents/integration/test/AgentWithOpenAIExample.java
|
@xintongsong |
Linked issue: #319
Purpose of change
This PR adds support for the Open AI chat model as a foundational model.
Tests
Added one IT test, also tried manually with ReactAgentExample but replace Ollama model with OpenAI one.
API
No
Documentation
doc-neededYes, will update docs once this get merged.