Replies: 1 comment
-
Any thoughts on this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I try to access the response from the
send_message
method in a loop, I am receiving a TypeError stating that string indices must be integers, not 'str'. Here is a snippet of the code I am using:Exact Error:
Rather, when I print chunk to see what's happening, the code produced the following output, where each character is printed separately, rather than providing a cohesive message or data object:
From the output, it seems that the
client.send_message
method is returning a string instead of a more structured data type like a list or a generator of messages. This is causing the for loop to iterate over each character in the string individually.Any guidance on how to modify this code to correctly greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions