-
Notifications
You must be signed in to change notification settings - Fork 98
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
Talking to NPC after running and getting no reply #14
Comments
I have also encountered the same mistake as yours. I think I can provide the situation I have encountered and the solution for your reference. I was checking the content returned by gpt and I found that my gpt returned 10 conversations in this format: {"content":"{name} : xxx"}. But the project's code seemed to want only one such reply, so I added the prompt word, and at the end of the prompt I forced my gpt to give only one dialog, like # 5 in the example below. .\agent\prompt\chat.txt You must follow the following criteria:
{"content":"{name} : xxx"}
After making this change, my project no longer reported such errors, and it began to work normally |
Thanks for the solution! |
@libinhang and I encountered the similar issue, some error message popped when it failed to get the text in what works for us is simply ignore this by hardcoding a content: Hope this helps |
我问与NPC交谈,这一部分代码在哪里实现的 |
Hello, when I reproduce your project, I can open the scene normally and add the preset scenes and NPCs. But when I have a conversation with the NPC, the NPC won't respond. In the logs/xxx_prompt.txt file, there is only the content sent by the system, and there is no GPT reply content, and the terminal displays such an error after a long time:
Exception in callback functools.partial(<function WebSocketProtocol._run_callback.. at 0x7efe8d7468b0>, <Task finished name='Task-16' coro=<WebSocketHandler.on_message() done, defined at /mnt/c /Users/jonny/AgentSims/main.py:23> exception=KeyError('content')>)
Traceback (most recent call last):
File "/home/jonny/.local/lib/python3.9/site-packages/tornado/ioloop.py", line 738, in _run_callback
ret = callback()
File "/home/jonny/.local/lib/python3.9/site-packages/tornado/websocket.py", line 639, in
self.stream.io_loop.add_future(result, lambda f: f.result())
File "/mnt/c/Users/jonny/AgentSims/main.py", line 24, in on_message
await self.app_cache.execute(self, message)
File "/mnt/c/Users/jonny/AgentSims/app.py", line 181, in execute
res = await cmd._execute(info)
File "/mnt/c/Users/jonny/AgentSims/command/command_base.py", line 40, in _execute
data = await self. execute(params)
File "/mnt/c/Users/jonny/AgentSims/command/chat/ChatWithNPC.py", line 43, in execute
response = result["data"]['chat']['content']
KeyError: 'content'
I would like to ask what is the problem, is there something wrong with my API Key?
The text was updated successfully, but these errors were encountered: