Skip to content

Conversation component, numeric content: "Speaker is specified but no exact corresponding output can be found in" #187

Description

@lpkant

Hey :-)

We stumbled over a very weird behavior - it took a while to pinpoint why our LLM calls would do different things sometimes; in cases where the user only "answered" with a numeric value, e.g. age or a specific year, the Conversation component does strange things.

It seems that POML issues a warning to the console but otherwise "successfully" completes the call - so the actual error message only shows up when you execute it directly in cmd but it won't get to my logging provider.

Image

As you can see in the second output - we are mitigating the whole thing with constructing a Q&A format...

This is the code that I am using for showcasing, similar to the actual implementation:

from poml import poml

markup = """<poml>
<conversation messages="{{ user_feedback_conversation }}" />
</poml>"""


print("\n")
print("\033[31m- First output (not working): \033[0m")

user_feedback_conversation = []
user_feedback_conversation.append({"speaker": "ai", "content": f"What is your age?"})
user_feedback_conversation.append({"speaker": "human", "content":  f"99"})

output = poml(markup, context={"user_feedback_conversation": user_feedback_conversation})

print(output)

print("\n")
print("\033[32m- Second output (mitigated, alpha-numeric answer): \033[0m")

user_feedback_conversation = []
user_feedback_conversation.append({"speaker": "ai", "content": f"Q: What is your age?"})
user_feedback_conversation.append({"speaker": "human", "content":  f"A: 99"}) # if the answer is numeric, POML ignores the whole entry, so we add "A: " prefix

output = poml(markup, context={"user_feedback_conversation": user_feedback_conversation})

print(output)

print("\n")

Thanks in advance!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions