Skip to content
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

Spring AI should allow function calling to be proxied for a remove invocation by OpenAI clients #1367

Closed
csterwa opened this issue Sep 16, 2024 · 0 comments

Comments

@csterwa
Copy link

csterwa commented Sep 16, 2024

Expected Behavior

OpenAI python client application calls a Spring AI application. The Spring AI Server is configured so that functional calling does not invoke a local (JVM) Java function, but calls back to to the python client application. Consider the case of how this solution looks for the case where there are advisors that would be invoked after the assistant message is returned and function calling is complete.

Current Behavior

Not sure if the current interfaces accommodate this use case.

Related Issues

#1177, #1032, #656, #652, #368

@csterwa csterwa added the openai label Sep 16, 2024
@csterwa csterwa changed the title Fine-grained client control over function invocation Spring AI should allow function calling to be proxied for a remove invocation by OpenAI clients Sep 16, 2024
@tzolov tzolov self-assigned this Sep 18, 2024
@tzolov tzolov added this to the 1.0.0-M3 milestone Sep 18, 2024
tzolov added a commit to tzolov/spring-ai that referenced this issue Sep 23, 2024
 This commit introduces a new proxyToolCalls option for various chat
 models in the Spring AI project. When enabled, it allows the client to
 handle function calls externally instead of being processed internally
 by Spring AI.

 The change affects multiple chat model implementations, including:
  AnthropicChatModel
  AzureOpenAiChatModel
  MiniMaxChatModel
  MistralAiChatModel
  MoonshotChatModel
  OllamaChatModel
  OpenAiChatModel
  VertexAiGeminiChatModel
  ZhiPuAiChatModel

 The proxyToolCalls option is added to the respective chat options
 classes and integrated into the AbstractToolCallSupport class for
 consistent handling across different implementations.

 The proxyToolCalls option can be set either programmatically via
 the <ModelName>ChatOptions.builder().withProxyToolCalls() method
 or the spring.ai.<model-name>.chat.options.proxy-tool-calls
 application property.

 Documentation for the new option is also updated in the relevant
 Antora pages.

 Resolves spring-projects#1367
tzolov added a commit to tzolov/spring-ai that referenced this issue Sep 23, 2024
 This commit introduces a new proxyToolCalls option for various chat
 models in the Spring AI project. When enabled, it allows the client to
 handle function calls externally instead of being processed internally
 by Spring AI.

 The change affects multiple chat model implementations, including:
  AnthropicChatModel
  AzureOpenAiChatModel
  MiniMaxChatModel
  MistralAiChatModel
  MoonshotChatModel
  OllamaChatModel
  OpenAiChatModel
  VertexAiGeminiChatModel
  ZhiPuAiChatModel

 The proxyToolCalls option is added to the respective chat options
 classes and integrated into the AbstractToolCallSupport class for
 consistent handling across different implementations.

 The proxyToolCalls option can be set either programmatically via
 the <ModelName>ChatOptions.builder().withProxyToolCalls() method
 or the spring.ai.<model-name>.chat.options.proxy-tool-calls
 application property.

 Documentation for the new option is also updated in the relevant
 Antora pages.

 Resolves spring-projects#1367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants