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

[Bug]: Error when creating a langchain model using OpenAI #9285

Open
Dmfama20 opened this issue Jun 3, 2024 · 1 comment
Open

[Bug]: Error when creating a langchain model using OpenAI #9285

Dmfama20 opened this issue Jun 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Dmfama20
Copy link

Dmfama20 commented Jun 3, 2024

Short description of current behavior

I've created a langchain engine as described here and then followed the instructions to create an agent with an text2sql-skill as described here. I.e.

CREATE MODEL my_model PREDICT answer USING engine = 'langchain', input_column = 'question', openai_api_key = 'your-model-api-key', -- choose one of OpenAI (openai_api_key) or Anthropic (anthropic_api_key) model_name='gpt-4', -- optional model name from OpenAI or Anthropic mode = 'conversational', user_column = 'question' , assistant_column = 'answer', max_tokens=100, temperature=0, verbose=True, prompt_template='Answer the user input in a helpful way';

CREATE SKILL text_to_sql_skill USING type = 'text2sql', database = 'example_db', -- this is a data source that must be connected to MindsDB with CREATE DATABASE statement tables = ['sales_data'], -- this table comes from the connected example_db data source description = "Sales data that includes stores, sold products, and other sale details";

CREATE AGENT support_agent USING model = 'my_model', -- this was created with CREATE MODEL skills = ['text_to_sql_skill']; -- this was created with CREATE SKILL

Now when I try to query my agent via
SELECT * FROM support_agent WHERE question = "Your question here";

I get the error

[langchain_engine/my_model]: AttributeError: 'OpenAIConfig' object has no attribute 'model_dump'

Video or screenshots

No response

Expected behavior

No response

How to reproduce the error

No response

Anything else?

No response

@Dmfama20 Dmfama20 added the bug Something isn't working label Jun 3, 2024
@sidahuja69
Copy link

any luck with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants