Open Sanzid88888 opened 4 months ago
quick solution that worked for me and got the sql agent up and working without issue: llm.provider_stop_sequence_key_name_map = {'anthropic': 'stop_sequences', 'amazon': 'stopSequences', 'ai21': 'stop_sequences', 'cohere': 'stop_sequences', 'mistral': 'stop','meta': 'stop' }
FYI: I'm working on using langchain create_sql_agent to work with Llama 3 instruct model on bedrock. Implementing this small change has gotten the agent to work without any issues!
TypeError: Additional kwargs key generation_token_count already exists in left dict and value has unsupported type <class 'int'> it s giving this new issue
quick solution that worked for me and got the sql agent up and working without issue: llm.provider_stop_sequence_key_name_map = {'anthropic': 'stop_sequences', 'amazon': 'stopSequences', 'ai21': 'stop_sequences', 'cohere': 'stop_sequences', 'mistral': 'stop','meta': 'stop' }
FYI: I'm working on using langchain create_sql_agent to work with Llama 3 instruct model on bedrock. Implementing this small change has gotten the agent to work without any issues!
@AyushSonuu i got the same error as you, when trying to implement @SteveMama solution
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
When invoking BedrockChat with the meta-model, an error occurs stating that the "Stop sequence" key name is not supported. This issue arises because the create_react_agent function includes a parameter llm_with_stop which is bound to the stop sequence ["\nObservation"], but the meta-model does not support the use of a stop sequence.
System Info
langchain==0.1.12 langchain-community==0.0.28 langchain-core==0.1.32 langchain-google-genai==0.0.11 langchain-openai==0.0.8 langchain-text-splitters==0.0.1 langchainhub==0.1.15
Platform: Mac Python 3.11.6