Replies: 1 comment
-
|
I could reproduce this issue. It seems like the combination of optional outputs and looping pipelines confuses the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
AmazonBedrockChatGeneratorto be able to use Claude models. As result my prompt builder component is aDynamicChatPromptBuilder.As a runtime variable I am defining
invalid_repliesanderror_messageto guide the prompt in order to fix errors if there are any. Theifcondition is stated in a Jinja template in the prompt.When I connect the
OutputValidatoroutputs toruntime_variables, the pipeline outputs:{}. However when there is no loop and I initialize theruntime_variablesexplicitly in thedataargument ofrunand break the loop, my pipeline works.Haystack version: 2.1.2
Below is the code:
Output:
{}Output without Loop:
{'output_validator': {'valid_replies': [ChatMessage(content='{\n "positive_experience": ["Quality of products"],\n "negative_experience": ["Bad Courier behavior"]\n}', role=<ChatRole.ASSISTANT: 'assistant'>, name=None, meta={'id': 'msg_01Sa75CDq79Ynv52RUx59hRb', 'model': 'claude-3-sonnet-28k-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 226, 'output_tokens': 31}})]}, 'prompt_builder': {'prompt': [ChatMessage(content="You are an experienced and accurate Turkish CX speacialist that classifies customer comments into pre-defined categories below:\n\nNegative experience labels:\n- Late delivery\n- Rotten/spoilt item\n- Bad Courier behavior\n\nPositive experience labels:\n- Good courier behavior\n- Thanks & appreciation\n- Love message to courier\n- Fast delivery\n- Quality of products\n\nCreate a JSON object as a response. The fields are: 'positive_experience', 'negative_experience'.\nAssign at least one of the pre-defined labels to the given customer comment under positive and negative experience fields. If the comment has a positive experience, list the label under positive_experience field. If the comments has a negative_experience, list it under the 'negative_experience' field.", role=<ChatRole.SYSTEM: 'system'>, name=None, meta={}), ChatMessage(content="Here is the comment:\nürünler iyiydi ama kurye kafama atsaydı keşke.\n. Just return the category names in the list. If there aren't any, return an empty list.\n\n", role=<ChatRole.USER: 'user'>, name=None, meta={})]}, 'llm': {'replies': [ChatMessage(content='{\n "positive_experience": ["Quality of products"],\n "negative_experience": ["Bad Courier behavior"]\n}', role=<ChatRole.ASSISTANT: 'assistant'>, name=None, meta={'id': 'msg_01Sa75CDq79Ynv52RUx59hRb', 'model': 'claude-3-sonnet-28k-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 226, 'output_tokens': 31}})]}}Beta Was this translation helpful? Give feedback.
All reactions