How to resolve - 'AIMessage' object is not subscriptable error

Annie George 0 Reputation points

Tried to run azure chat openai via langchain but we got this error. User's image

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
1,410 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 10,340 Reputation points

    Check where in your code the 'AI Message' object is being used with square brackets. Look for lines that are trying to access elements like ai_message[some_index] or ai_message["some_key"]

    0 comments No comments