ix icon indicating copy to clipboard operation
ix copied to clipboard

MissingCommandMarkers

Open cybriz opened this issue 1 year ago • 5 comments

Screenshot 2023-05-25 145926

Hi, I don't know how to resolve this issue. What might be the cause of this error?

cybriz avatar May 25 '23 07:05 cybriz

I am blocked by this as well.

killerapp avatar May 25 '23 11:05 killerapp

Same. +1

ctzurcanu avatar May 25 '23 12:05 ctzurcanu

MissingCommandMarkers indicates ParseJSON couldn't find json in the response.

This is most often caused when the bot doesn't know who to delegate to or how to respond. If you give it a more specific question such as, "code me a python fizzbuzz" it should work better.

kreneskyp avatar May 25 '23 14:05 kreneskyp

prompt: code me a python fizzbuzz answer: Delegating to @python_code DoesNotExist Agent matching query does not exist.

But the make worker process shows the answer in the console log:

Here's a Python code for FizzBuzz:

for i in range(1, 101):
    if i % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

ctzurcanu avatar May 25 '23 14:05 ctzurcanu

yes, it happens to me as well. The answer shows on the console log but the ui return 'MissingCommandMarkers '

cybriz avatar May 25 '23 14:05 cybriz

This is usually because the AI is outputting the answer directly and not formatting it in the JSON style requested.

It happens with both gpt-3.5-turbo and gpt-4 models, but gpt-3.5 is a lot worse with it.

An example I got yesterday:

ix-worker-1  | [2023-05-25 04:12:25,570: WARNING/ForkPoolWorker-1] Prompt after formatting:
ix-worker-1  | AI: 
ix-worker-1  | You are a chat moderator. You direct messages to the agent who can best response to the user request
ix-worker-1  | 
ix-worker-1  | AGENTS:
ix-worker-1  | 0. code: To generate code for a user request. May generate multiple files
ix-worker-1  | 
ix-worker-1  | AGENT_FORMAT:
ix-worker-1  | ###START###
ix-worker-1  | {"agent": "agent_name"}
ix-worker-1  | ###END###
ix-worker-1  | 
ix-worker-1  | QUESTION_FORMAT:
ix-worker-1  | ###START###
ix-worker-1  | {"question": "question text"}
ix-worker-1  | ###END###
ix-worker-1  | 
ix-worker-1  | INSTRUCTION:
ix-worker-1  | - Choose the agent from AGENTS who will process the user request.
ix-worker-1  | - Respond in AGENT_FORMAT if returning an AGENT.
ix-worker-1  | - If no AGENT can process the request, respond with QUESTION_FORMAT for a clarifying QUESTION.
ix-worker-1  | - DO NOT ADD EXTRA FIELDS TO THE EXPECTED FORMAT
ix-worker-1  | 
ix-worker-1  | Human: This is a test, what is the capital of Brazil?
ix-worker-1  | [2023-05-25 04:12:28,293: WARNING/ForkPoolWorker-1] 
ix-worker-1  | > Finished chain.
ix-worker-1  | 2023-05-25 04:12:28 DEBUG Moderator returned response=I can answer that question for you! The capital of Brazil is Brasília. 

Note: This is a poor question to ask IX, it prefers a task. In saying that, I received the exact same issue when I had it write a python script, I just can't find the logs for it. It simply output the entire script directly from the IX agent, on another attempt it successfully delegated to the code agent, then the code agent output the entire script disregarding the format as well

You can see it is completely disregarding the requested output format and responding directly with the answer to the question. This then throws an error, IX is attempting to process the output and it is not in the expected format and does not include any of the potential command markers ('question' or 'agent' in a JSON object).

My ideas to fix this issue:

  1. Prevent this error from halting the worker, letting the worker view the error and attempt to figure out its own solution to it (which would be to format the output as requested)
  2. Improving the prompt to increase the success rate of receiving correctly formatted data output
  3. Introducing another chain for JSON 'fixing' (as auto-gpt has). Upon detecting incorrect JSON, a JSON repair agent could be spawned, tasked with correcting the output. Alternatively the agent that made the error could be re-prompted to output in the specified format.
  4. Allowing delegation agent (IX) to respond to questions it can provide the answers to or adding another agent that is suited to direct question answering.

Please feel free to critique my ideas above, all feedback is welcome, I'll be working on a PR to resolve this soon

fetwar avatar May 25 '23 23:05 fetwar

This should be resolved in v0.3.:

  • @code and @ix agents were both reworked to use OpenAI functions. This eliminates most JSON parse failures.
  • @ix now responds general inquiries and whenever it cant choose an agent to delegate to.

kreneskyp avatar Jun 26 '23 23:06 kreneskyp