deepset-ai / haystack

:mag: LLM orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
14.67k stars 1.72k forks source link

Provide an abstraction for Tools #7674

Open anakin87 opened 2 months ago

anakin87 commented 2 months ago

In the past, only OpenAI provided support for function calling. Today, many Language Model providers/libraries support this feature, using Tools specification or similar.

Also in the context of the upcoming work for Agents, we should:

Resources:

@vblagoje @julian-risch @mrm1001

vblagoje commented 2 months ago

@anakin87 thanks for this write up; while at it, it would be nice to have a discussion about:

CarlosFerLo commented 2 months ago

It will also be cool if we could use like a response parser component that worked with any generator and enriched responses, for example to use function calling or to extract keywords or something. This way we could both support OpenAIs models but also open source ones that may have different ways of function calling.

Specially as making the model say, for example:

Thought: $ Some text $
Action: $ Tool key $
Action Input: $ Input to the tool $

as in the ReAct Paper might be beneficial for model generation as it is more natural than writing json objects or similar. This way everyone can customize the parsing to their specific use case and model, asi if I am writting now an example to implement Chameleon on haystack and the Parser might be really different from the one at a normal React or with OpenAI functions.

vblagoje commented 1 month ago

Moving to P1 and Backlog as agreed with @shadeMe

masci commented 1 month ago

One example of abstracting tools: https://github.com/deepset-ai/haystack/issues/7613

anakin87 commented 1 day ago

https://blog.langchain.dev/tool-calling-with-langchain/