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

Is the SqlToolkit agent toolkit only supported for OpenAI LLMs? #563

Closed
mikebars opened this issue Apr 1, 2023 · 3 comments
Closed

Is the SqlToolkit agent toolkit only supported for OpenAI LLMs? #563

mikebars opened this issue Apr 1, 2023 · 3 comments

Comments

@mikebars
Copy link

mikebars commented Apr 1, 2023

I see that in the SqlToolkit constructor it creates a QueryCheckerTool without arguments:

Which causes the else branch of the QueryCheckerTool constructor to run:

Which then creates the default OpenAI LLMChain

Here's a reproduction of the issue (attempting to use the HuggingFaceInference LLM):

And here is a patch I made that appears to allow the functionality to progress further:

And here is my patched code that is able to reach a different error state:

However, I still get an error as output, which makes me think perhaps these cases are not yet supported:

Error: Could not parse LLM output: Action: list-tables-sql
Action Input:
Observation: a list of tables
Th
    at ZeroShotAgent.extractToolAndInput (file:///home/user/langchain-projects/projects/langchain-test/node_modules/langchain/src/agents/mrkl/index.ts:111:13)
    at ZeroShotAgent._plan (file:///home/user/langchain-projects/projects/langchain-test/node_modules/langchain/src/agents/agent.ts:159:31)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AgentExecutor._call (file:///home/user/langchain-projects/projects/langchain-test/node_modules/langchain/src/agents/executor.ts:75:22)
    at async AgentExecutor.call (file:///home/user/langchain-projects/projects/langchain-test/node_modules/langchain/src/chains/base.ts:94:22)
@hkd987
Copy link
Contributor

hkd987 commented Apr 1, 2023

I’ve been running into the same issues as you and came to mostly the same conclusions as you. I’ve found this comment on the langchain repo that makes me think a very custom fine tuning is going to be be needed to get a SQL agent with a huggingface model to work the way I want.

@hkd987
Copy link
Contributor

hkd987 commented Apr 1, 2023

I’m actually thinking of using OpenAI SQL Agent questions/answers and building a fine tuning data set, that I can then plug into a Huggingface model.

If you have any other ideas or find a better solution I’d love to hear/talk about it.

@dosubot
Copy link

dosubot bot commented Aug 18, 2023

Hi, @mikebars! I'm here to help the LangChain team manage their backlog and I wanted to let you know that we are marking this issue as stale.

From what I understand, you reported an issue with the SqlToolkit agent toolkit in the langchainjs repository. It seems that when using the HuggingFaceInference LLMChain with the toolkit, you encountered an error. Another user, @hkd987, also faced similar issues and suggested that a custom fine-tuning may be needed to get a SQL agent with a HuggingFace model to work. They mentioned considering using OpenAI SQL Agent questions/answers and building a fine-tuning dataset.

Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your understanding and we look forward to your response.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Aug 18, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 10, 2023
jacoblee93 pushed a commit that referenced this issue Oct 9, 2024
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

No branches or pull requests

2 participants