+
+
+ Generator(
+ model_kwargs={'model': 'llama3-8b-8192'},
+ (prompt): Prompt(
+ template: {% if task_desc_str or output_format_str or tools_str or examples_str or chat_history_str or context_str or steps_str %}
+
+ {% endif %}
+ {# task desc #}
+ {% if task_desc_str %}
+ {{task_desc_str}}
+ {% endif %}
+ {# output format #}
+ {% if output_format_str %}
+
+ {{output_format_str}}
+
+ {% endif %}
+ {# tools #}
+ {% if tools_str %}
+
+ {{tools_str}}
+
+ {% endif %}
+ {# example #}
+ {% if examples_str %}
+
+ {{examples_str}}
+
+ {% endif %}
+ {# chat history #}
+ {% if chat_history_str %}
+
+ {{chat_history_str}}
+
+ {% endif %}
+ {#contex#}
+ {% if context_str %}
+
+ {{context_str}}
+
+ {% endif %}
+ {# steps #}
+ {% if steps_str %}
+
+ {{steps_str}}
+
+ {% endif %}
+ {% if task_desc_str or output_format_str or tools_str or examples_str or chat_history_str or context_str or steps_str %}
+
+ {% endif %}
+ {% if input_str %}
+
+ {{input_str}}
+
+ {% endif %}
+ You:
+ , prompt_variables: ['output_format_str', 'chat_history_str', 'task_desc_str', 'context_str', 'steps_str', 'input_str', 'tools_str', 'examples_str']
+ )
+ (model_client): GroqAPIClient()
+ )
+
+
+
+
+**Show the final prompt**
+
+`Generator` 's ``print_prompt`` method will simply relay the method from the `Prompt` component:
+
+.. code-block:: python
+
+ prompt_kwargs = {"input_str": "What is LLM? Explain in one sentence."}
+ generator.print_prompt(**prompt_kwargs)
-1. Trace the history change(states) on prompt during your development process. Developers typically go through a long process of prompt optimization and it is frustrating
-to lose track of the prompt changes when your current change actually makes the performance much worse.
+The output will be the formatted prompt:
-We created a `GeneratorStateLogger` to handle the logging and saving into json files. To further simplify developers's process,
-we provides a class decorator `trace_generator_states` where a single line of code can be added to any of your task component.
-It will automatically track any attributes of type `Generator`.
+.. code-block::
+
+