Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to strip inner thoughts from kwarg (SDK) #1967

Open
quantumalchemy opened this issue Nov 1, 2024 · 2 comments
Open

Failed to strip inner thoughts from kwarg (SDK) #1967

quantumalchemy opened this issue Nov 1, 2024 · 2 comments
Labels

Comments

@quantumalchemy
Copy link

quantumalchemy commented Nov 1, 2024

USING SDK
response = memgpt_client.send_message(
agent_id=agent_id,
message=prompt,
role="user",
)
--->
*llm_api/helpers.py:184: UserWarning: Failed to strip inner thoughts from kwargs: Unterminated string starting at: line 2 column 14 (char 15)
warnings.warn(f"Failed to strip inner thoughts from kwargs: {e}")
Letta.letta.server.server - ERROR - Error in server._step: Unterminated string starting at: line 2 column 14 (char 15)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/letta/server/server.py", line 435, in _step
usage_stats = letta_agent.step(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/agent.py", line 749, in step
step_response = self.inner_step(
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/agent.py", line 958, in inner_step
raise e
File "/usr/local/lib/python3.11/site-packages/letta/agent.py", line 874, in inner_step
response = self._get_ai_reply(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/agent.py", line 501, in _get_ai_reply
raise e
File "/usr/local/lib/python3.11/site-packages/letta/agent.py", line 472, in _get_ai_reply
response = create(
^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/llm_api_tools.py", line 97, in wrapper
raise e
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/llm_api_tools.py", line 66, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/llm_api_tools.py", line 170, in create
response = unpack_all_inner_thoughts_from_kwargs(response=response, inner_thoughts_key=INNER_THOUGHTS_KWARG)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/helpers.py", line 147, in unpack_all_inner_thoughts_from_kwargs
new_choices.append(unpack_inner_thoughts_from_kwargs(choice, inner_thoughts_key))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/helpers.py", line 185, in unpack_inner_thoughts_from_kwargs
raise e
File "/usr/local/lib/python3.11/site-packages/letta/llm_api/helpers.py", line 165, in unpack_inner_thoughts_from_kwargs
func_args = dict(json.loads(tool_call.function.arguments))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Unterminated string starting at: line 2 column 14 (char 15)
None

------ Installed
letta latest: 051
pip install -U letta
LLM endpoint (api.memgpt.ai)

@quantumalchemy quantumalchemy changed the title Failed to strip inner thoughts from kwarg Failed to strip inner thoughts from kwarg (SDK) Nov 1, 2024
@mattzh72
Copy link
Collaborator

Just wondering, would you be able to share more details, like the code, conversation history, etc.?

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants