I might be wrong about this, it seems that only string-type args are now supported?
I tried to implement other arg types, among which I found list to be most tricky. As my understanding, one has to recursively define the type of the element in the list, until the element is not a list (e.g. List[List[str]]). There might be same issue with dict.
If the type of element in the list is not clearly defined, there will be an error like this
InvalidRequestError Traceback (most recent call last)
[... skipping hidden 1 frame]
C:\Users\CHU~1\AppData\Local\Temp/ipykernel_32712/1691176088.py in <module>
----> 1 session.ask("how's it going?")
~\PycharmProjects\catalyst\CallingGPT\CallingGPT\session\session.py in ask(self, msg)
48
---> 49 resp = openai.ChatCompletion.create(
50 **args
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\openai\api_resources\chat_completion.py in create(cls, *args, **kwargs)
24 try:
---> 25 return super().create(*args, **kwargs)
26 except TryAgain as e:
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py in create(cls, api_key, api_base, api_type, request_id, api_version, organization, **params)
152
--> 153 response, _, api_key = requestor.request(
154 "post",
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\openai\api_requestor.py in request(self, method, url, params, headers, files, stream, request_id, request_timeout)
297 )
--> 298 resp, got_stream = self._interpret_response(result, stream)
299 return resp, got_stream, self.api_key
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\openai\api_requestor.py in _interpret_response(self, result, stream)
699 return (
--> 700 self._interpret_response_line(
701 result.content.decode("utf-8"),
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\openai\api_requestor.py in _interpret_response_line(self, rbody, rcode, rheaders, stream)
762 if stream_error or not 200 <= rcode < 300:
--> 763 raise self.handle_error_response(
764 rbody, rcode, resp.data, rheaders, stream_error=stream_error
<class 'str'>: (<class 'TypeError'>, TypeError('__str__ returned non-string (type list)'))
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
[... skipping hidden 1 frame]
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2080 value, tb, tb_offset=tb_offset)
2081
-> 2082 self._showtraceback(etype, value, stb)
2083 if self.call_pdb:
2084 # drop into debugger
C:\ProgramData\Miniconda3\envs\catalyst\lib\site-packages\ipykernel\zmqshell.py in _showtraceback(self, etype, evalue, stb)
541 'traceback' : stb,
542 'ename' : str(etype.__name__),
--> 543 'evalue' : str(evalue),
544 }
545
TypeError: __str__ returned non-string (type list)