Skip to content

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Feb 6, 2024

Add support for ChatClient function calling.

  • Add generic (model) ToolFunctionCallback and AbstractToolFunctionCallback abstractions for defining and registering function callbacks with the ChatClient.
  • OpenAiChatClient Function calling implementation.
  • Unit/IT tests for OpenAiApi and OpenAiChatClient function calling.
  • Add function calling docs.

@tzolov tzolov added the enhancement New feature or request label Feb 6, 2024
@tzolov tzolov added this to the 0.8.0 milestone Feb 6, 2024
@tzolov tzolov force-pushed the openai-tools-support branch from fb3e0f5 to 144fa5d Compare February 10, 2024 18:06
void setTopK(Integer topK);

default List<ToolFunctionCallback> getToolCallbacks() {
throw new UnsupportedOperationException("ToolCallbacks is not supported by this model");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not have this default method, since the methods here should apply to every model.

throw new UnsupportedOperationException("ToolCallbacks is not supported by this model");
}

default void setToolCallbacks(List<ToolFunctionCallback> toolCallbacks) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as before

}

@Override
public String toString() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added equals and hashcode on merge.

@markpollack
Copy link
Member

removed the default methods in the chat option interface to make tests pass.

Merged as ffd8222

Can review the small comments in this PR afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants