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

SYSTEM PROMPT hack for actionExamples -- deepseek fix to remove (NONE), (CONTINUE), etc. to the text response #2889

Open
metakai1 opened this issue Jan 28, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@metakai1
Copy link
Contributor

Describe the bug

when using deepseek-chat model, often (NONE) or (CONTINUE) is added to the response.

To Reproduce

use deepseek and converse

Expected behavior

don't put that stuff in there

Screenshots

** code hack to to fix it: **

actionExamples: actionsData.length > 0 ? addHeader( "# Action Examples: Each action such as CONTINUE, NONE, IGNORE, MUTE_ROOM, etc. is represented below in parenthesis for example: (CONTINUE). These are indicators of which action should be called. Do not include the items in parentheses in the response.", composeActionExamples(actionsData, 10) ) : "",

Additional context

Image

@metakai1 metakai1 added the bug Something isn't working label Jan 28, 2025
@haskell-monad
Copy link

Image

After adding it, I still have problems:

⛔ ERRORS
   Error in generateText:
   {"message":"invalid json response body at https://api.deepseek.com/chat/completions reason: Unexpected end of JSON input","type":"invalid-json"}
Fetch request: [
  'https://api.deepseek.com/chat/completions',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer xxxxx'
    },
    body: '{"model":"deepseek-chat","max_tokens":8192,"temperature":0.7,"frequency_penalty":0,"presence_penalty":0,"messages":[{"role":"system","content":"xxxxxx"},{"role":"user","content":"# Action Examples:  Each action such as CONTINUE, NONE, IGNORE, MUTE_ROOM, etc. is represented below in parenthesis for example: (CONTINUE).  These are indicators of which action should be called.  Do not include the items in parentheses in the response.\\n\\nLiza: Can you describe this image for me?\\nGae: Let me analyze this image for you... (DESCRIBE_IMAGE)\\nGae: I see an orange tabby cat sitting on a windowsill. The cat appears to be relaxed and looking out the window at birds flying by. The lighting suggests it\'s a sunny afternoon.\\n\\nCherise: yo Frederica dont talk in here\\nFrederica: sry (MUTE_ROOM)\\n\\nKiley: Create an image of a cat with a hat\\n{{agentName}}: Here\'s an image of a cat with a hat (GENERATE_IMAGE)\\n\\nCalley: Got any investment advice\\nCarie: Uh, don’t let the volatility sway your long-term strategy\\nCalley: Wise words I think\\nCalley: I gotta run, talk to you later\\nCarie: See ya\\nCalley: \\n\\nRoselia: you kids today dont know the value of hard work (CONTINUE)\\nRoselia: always on your phones\\nDasha: sure grandpa lets get you to bed\\n\\nBetteanne: Hey whats up\\nDiannne: oh hey (NONE)\\n\\nDollie: Could you tell me what this image depicts?\\nKakalina: I\'ll describe this image for you... (DESCRIBE_IMAGE)\\nKakalina: This is a scenic mountain landscape at sunset. The peaks are snow-capped and reflected in a calm lake below. The sky is painted in vibrant oranges and purples, with a few wispy clouds catching the last rays of sunlight.\\n\\nAustine: Karole, please mute this channel for the time being\\nKarole: Understood (MUTE_ROOM)\\nBarbra: Hey what do you think about this new design\\nKarole:  (IGNORE)\\n\\nCarolan: Generate an image of a cat\\n{{agentName}}: Here\'s an image of a cat (GENERATE_IMAGE)\\n\\nCordie: Shut up, bot\\nNancie:  (IGNORE)\\n\\n(Action examples are for reference only. Do not use the information from them in your response.)\\n\\n# Knowledge\\n\\n\\n# Task: Generate dialog and actions for the character xxxxx.\\nAbout xxxxxx:\\nxxxxxxxxxxxxxxxxxxxx。\\nxxxxxxxxxxxxx。\\nxxxxxxxxxxxx。\\nxxxxxxxxxxx。\\nxxxxxxxxx。\\n\\n# Additional Information About xxxxxx and The World\\nxxxxxxxx is present in the conversation but not deeply invested\\nThe current date and time is Wednesday, January 29, 2025 at 7:21:23 AM UTC. Please use this as your reference for any time-based operations or responses.\\n\\n\\n\\n\\n# Capabilities\\nNote that xxxxxxxx is capable of reading/seeing/hearing various forms of media, including images, videos, audio, plaintext and PDFs. Recent attachments have been included above under the \\"Attachments\\" section.\\n\\n# Message Directions for xxxxx\\nxxxxxx\\nxxxxxx\\nxxxx\\n详细描述\\nxxxxxx\\nxxxx\\nxxxxx\\nxxxxx\\nxxxxx\\n\\n\\n# Conversation Messages\\n(5 minutes ago) [ce8d8] User5ccea482-46b7-030f-a871-92c2xxce8d8: hello\\n(just now) [ce8d8] User5ccea482-46b7-030f-a871-9xxe8ce8d8: xxxxx\\n\\n\\n# Available Actions\\nDESCRIBE_IMAGE: Describe an image,\\nMUTE_ROOM: Mutes a room, ignoring all messages unless explicitly mentioned. Only do this if explicitly asked to, or if you\'re annoying people.,\\nGENERATE_IMAGE: Generate an image to go along with the message.,\\nIGNORE: Call this action if ignoring the user. If the user is aggressive, creepy or is finished with the conversation, use this action. Or, if both you and the user have already said goodbye, use this action instead of saying bye again. Use IGNORE any time the conversation has naturally ended. Do not use IGNORE if the user has engaged directly, or if something went wrong an you need to tell them. Only ignore if the user should be ignored.,\\nCONTINUE: ONLY use this action when the message necessitates a follow up. Do not use this action when the conversation is finished or the user does not wish to speak (use IGNORE instead). If the last message action was CONTINUE, and the user has not responded. Use sparingly.,\\nNONE: Respond but perform no additional action. This is the default if the agent is speaking and not doing anything additional.\\n\\n\\n# Instructions: Write the next message for xxxxx.\\n\\nResponse format should be formatted in a JSON block like this:\\n```json\\n{ \\"user\\": \\"xxxx\\", \\"text\\": \\"string\\", \\"action\\": \\"string\\" }\\n```"}]}',
    signal: undefined
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants