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

feat: Add ServiceContainer Haystack 2.x component #6138

Closed
wants to merge 6 commits into from

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented Oct 20, 2023

Why:

  • To introduce a ServiceContainer component which facilitates managing a service instance and generating JSON descriptions for its methods. ServiceContainer will be used for LLM function calling by proxying LLM functional calls to ServiceContainer while ServiceContainer will in turn facilitate generating JSON descriptions for service's methods to register functions with LLMs.

What:

  • Added ServiceContainer component, which encapsulates a service instance and provides functionality for invoking methods on the service instance reflectively based on ChatMessage input and generating JSON descriptions for all methods of the service instance according to the OpenAI functional API specification.

How can it be used:

  • By instantiating the ServiceContainer with a service instance and utilizing the run method to process ChatMessage inputs.

How did you test it:

  • No tests, yet see section below

Notes for reviewer:

@vblagoje vblagoje requested a review from a team as a code owner October 20, 2023 13:41
@vblagoje vblagoje requested review from julian-risch and removed request for a team October 20, 2023 13:41
@github-actions github-actions bot added the type:documentation Improvements on the docs label Oct 20, 2023
@vblagoje vblagoje marked this pull request as draft October 20, 2023 13:41
@vblagoje vblagoje changed the title Add ServiceContainer component feat: Add ServiceContainer component Oct 20, 2023
@vblagoje vblagoje changed the title feat: Add ServiceContainer component feat: Add ServiceContainer Haystack 2.x component Oct 20, 2023
@vblagoje vblagoje added the 2.x Related to Haystack v2.0 label Oct 20, 2023
@vblagoje
Copy link
Member Author

The idea is to replace step 5 from LLM function calling https://colab.research.google.com/drive/1hPyK7DKXuMRRm03uE7-h-oG0X4h3Lvpx?usp=sharing It'll be an amazing feature. However we need #6109 and ChatMessage support first

@julian-risch
Copy link
Member

@vblagoje Once this PR is ready for review I won't be able to review it so somebody else needs to be assigned. I nominate @anakin87 🎉

@julian-risch julian-risch requested review from anakin87 and removed request for julian-risch October 27, 2023 12:56
@vblagoje
Copy link
Member Author

vblagoje commented Nov 2, 2023

There is a better way to do this via Pydantic. I'll close this draft and open a new one once it is ready cc @anakin87

@vblagoje vblagoje closed this Nov 2, 2023
@vblagoje vblagoje deleted the service_component branch November 12, 2023 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants