-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi team 👋, I’m running into a problem when trying to define an output schema in JSON format inside a POML file and use it with LangchainPomlTemplate.
POML FILE
<poml>
<system-msg>Extract the event information.</system-msg>
<human-msg>Alice and Bob are going to a science fair on Friday.</human-msg>
<output-schema>
z.object({
name: z.string(),
date: z.string(),
participants: z.array(z.string()),
});
</output-schema>
</poml>
Python code
from poml.integration.langchain import LangchainPomlTemplate
prompt = LangchainPomlTemplate.from_file("prompt_new.poml")
What happened
When I run this, I get the following error:
Input to LangchainPomlTemplate is missing variables {'\n name'}.
Expected: ['\n name']
Received: ['user_input', 'history']
Note: if you intended {\n name} to be part of the string and not a variable, please escape it with double curly braces like: '{{\n name}}'.
What I Expected
The schema in should be treated as plain text and not parsed as template variables.
Question
Is there a recommended way to define a schema inside so it doesn’t get treated as template variables?
Or should everything inside be automatically escaped?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working