i am trying to call this
thread = client.beta.threads.create()
but got this error
AttributeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 thread = client.beta.threads.create()
File ~/anaconda3/envs/llm/lib/python3.9/site-packages/openai/resources/beta/threads/threads.py:121, in Threads.create(self, messages, metadata, tool_resources, extra_headers, extra_query, extra_body, timeout)
95 """
96 Create a thread.
97
(...)
118 timeout: Override the client-level default timeout for this request, in seconds
119 """
120 extra_headers = {"OpenAI-Beta": "assistants=v2", **(extra_headers or {})}
--> 121 return self._post(
122 "/threads",
123 body=maybe_transform(
124 {
125 "messages": messages,
126 "metadata": metadata,
127 "tool_resources": tool_resources,
128 },
129 thread_create_params.ThreadCreateParams,
130 ),
131 options=make_request_options(
132 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
...
51 if isinstance(value, bytes):
52 return value
---> 53 return value.encode(encoding or "ascii")
AttributeError: 'tuple' object has no attribute 'encode'
i have tried update openai , and give message , but same error