Open gopi-tookitaki opened 3 months ago
@gopi-tookitaki the chat model does not seem to automatically handle system message
as a workaround update the template so that the instructions are part of the human message
is this an issue with langchain? or fireworks @eyurtsev
Checked other resources
Example Code
model = ChatFireworks(model=model_name) parser = PydanticOutputParser(pydantic_object=pydantic) prompt = ChatPromptTemplate.from_messages([ ("system", "Answer the user query. Wrap the output in json tags\n{format_instructions}"), ("human", "{query}"), ]).partial(format_instructions=parser.get_format_instructions()) chain = prompt | model | parser try: output = chain.invoke({"query": input}) except (OutputParserException, InvalidRequestError) as e: output = f"An error occurred: {e}"
Error Message and Stack Trace (if applicable)
No response
Description
An error occurred: {'error': {'object': 'error', 'type': 'invalid_request_error', 'message': 'jinja template rendering failed. System role not supported'}}
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found: