Open SashaDon opened 3 days ago
Hi @SashaDon! I haven't tried bedrock. What error are you getting?
Trying to process an unexpected response. %{"message" => "'{MY_BEDROCK_API_KEY_GOES_HERE}' not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer {MY_BEDROCK_API_KEY_GOES_HERE}'."}
10:52:05.771 [error] Error during chat call. Reason: "Unexpected response" ** (MatchError) no match of right hand side value: {:error, %LangChain.Chains.LLMChain{llm: %LangChain.ChatModels.ChatOpenAI{endpoint: "https://bedrock-runtime.us-east-1.amazonaws.com/model/amazon.titan-text-express-v1/invoke", model: "amazon.titan-text-express-v1", api_key: nil, temperature: 1.0, frequency_penalty: 0.0, receive_timeout: 60000, seed: nil, n: 1, json_response: false, stream: true, max_tokens: nil, stream_options: nil, callbacks: [%{on_llm_new_delta: #Function<0.19950590/2 in Chatbot.start/0>, on_message_processed: #Function<1.19950590/2 in Chatbot.start/0>}], user: nil}, verbose: false, verbose_deltas: false, tools: [], _tool_map: %{}, messages: [%LangChain.Message{content: "You are a helpful assistant. Provide concise and accurate responses to user queries.", processed_content: nil, index: nil, status: :complete, role: :system, name: nil, tool_calls: [], tool_results: nil}, %LangChain.Message{content: "hw", processed_content: nil, index: nil, status: :complete, role: :user, name: nil, tool_calls: [], tool_results: nil}], custom_context: nil, message_processors: [], max_retry_count: 3, current_failure_count: 0, delta: nil, last_message: %LangChain.Message{content: "hw", processed_content: nil, index: nil, status: :complete, role: :user, name: nil, tool_calls: [], tool_results: nil}, needs_response: true, callbacks: [%{on_llm_new_delta: #Function<0.19950590/2 in Chatbot.start/0>, on_message_processed: #Function<1.19950590/2 in Chatbot.start/0>}]}, "Unexpected response"} ai_experiments/alex/test_bedrock_langchain2.exs:59: Chatbot.chat_loop/1 ai_experiments/alex/test_bedrock_langchain2.exs:70: (file)
I am working on this project, and I want to use bedrock as I my chat service of choice, I tested this library with openai chatgpt-4, and it works perfectly.
Here is the code I am testing to connect to the aws bedrock api.
Can someone help me out, what am I doing wrong? or bedrock isn't supported yet?