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

Add tool support for LLMFactory and BaseLLM #836

Open
Undertone0809 opened this issue Aug 3, 2024 · 0 comments
Open

Add tool support for LLMFactory and BaseLLM #836

Undertone0809 opened this issue Aug 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Undertone0809
Copy link
Owner

🚀 Feature Request

Currently, if you use tool in pne.chat. ReAct prompt pattern will turn on default. Now lots of model support tool call, it more simple and fast. Need to add tool support for language model.

Change: when developer run the following example. Use model tool parameter default, rather than startup a Tool Agent.

import pne

def run_code(code: str):
    ...

response = pne.chat("give me a bubble sort and run it", tools=[run_code])

For LLM intergate litellm, a compatibility scheme is required. For other solutions, you need to determine whether provider is compatible with tool parameters. For details, see the implementation of langchain.

If want to use ToolAgent in pne.chat, using the following code:

import pne

def run_code(code: str):
    ...

response = pne.chat("give me a bubble sort and run it", tools=[run_code], enable_agent=True)
@Undertone0809 Undertone0809 added the enhancement New feature or request label Aug 3, 2024
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
Status: No status
Development

No branches or pull requests

1 participant