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

Introduce a way to configure tools per method of an AiService #613

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

geoand
Copy link
Collaborator

@geoand geoand commented May 22, 2024

This is done using the new @ToolBox annotation

@geoand geoand requested a review from cescoffier May 22, 2024 07:57
@geoand geoand requested a review from a team as a code owner May 22, 2024 07:57
@geoand
Copy link
Collaborator Author

geoand commented May 22, 2024

@cescoffier can you give this a try with the example you had in mind for the @ToolBox use case?

@cescoffier
Copy link
Collaborator

@geoand I will try it tomorrow.

@geoand
Copy link
Collaborator Author

geoand commented May 22, 2024

🙏

@geoand
Copy link
Collaborator Author

geoand commented May 28, 2024

I'll fix the conflict if we decide we want this

@geoand
Copy link
Collaborator Author

geoand commented Jun 3, 2024

@cescoffier can you have a look at this one?

@cescoffier
Copy link
Collaborator

@geoand Yes, I will try to use it on the demo we did last week.

@geoand
Copy link
Collaborator Author

geoand commented Jun 3, 2024

🙏🏼

@cescoffier
Copy link
Collaborator

Works!

    @UserMessage("""
            Extract the policy number from the given claim.
            Only return the policy number.
            
            {text}
            """)
    String extractPolicyNumber(String text);

    @UserMessage("""
            Check if there is an existing claim related to the given claim.
            Return the claim id, null if none.
                        
            The existing claim can be found by identifying the policy number from the given claim.
            
            If no claim is found, return -1.
            
            {text}
            
             """)
    @ToolBox(ClaimService.class)
    Long findRelatedClaims(String text);

Copy link
Collaborator

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

Documentation would be nice :-)

@geoand
Copy link
Collaborator Author

geoand commented Jun 3, 2024

Thanks for checking!

I will add some documentation while also fixing the conflict

This is done using the new @toolbox annotation

Closes: #42
@geoand
Copy link
Collaborator Author

geoand commented Jun 3, 2024

Done

@geoand geoand merged commit 1cc6634 into main Jun 3, 2024
11 of 12 checks passed
@geoand geoand deleted the #42 branch June 3, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow declaring tools on methods
2 participants