102102 },
103103 {
104104 "cell_type" : " code" ,
105- "execution_count" : 16 ,
105+ "execution_count" : null ,
106106 "metadata" : {
107107 "colab" : {
108108 "base_uri" : " https://localhost:8080/"
120120 " init_parameters:\n " ,
121121 " required_variables: null\n " ,
122122 " template:\n " ,
123- " - _content :\n " ,
123+ " - content :\n " ,
124124 " - text: '\n " ,
125125 " \n " ,
126- " Please create a summary about the following topic:\n " ,
126+ " Please create a summary about the following topic:\n " ,
127127 " \n " ,
128- " {{ topic }}\n " ,
128+ " {{ topic }}\n " ,
129129 " \n " ,
130- " '\n " ,
131- " _meta : {}\n " ,
132- " _name : null\n " ,
133- " _role : user\n " ,
130+ " '\n " ,
131+ " meta : {}\n " ,
132+ " name : null\n " ,
133+ " role : user\n " ,
134134 " variables: null\n " ,
135135 " type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder\n " ,
136136 " llm:\n " ,
137137 " init_parameters:\n " ,
138+ " chat_template: null\n " ,
139+ " enable_thinking: false\n " ,
138140 " generation_kwargs:\n " ,
139141 " max_new_tokens: 150\n " ,
142+ " return_full_text: false\n " ,
140143 " stop_sequences: []\n " ,
141144 " huggingface_pipeline_kwargs:\n " ,
142145 " device: cpu\n " ,
149152 " - HF_TOKEN\n " ,
150153 " strict: false\n " ,
151154 " type: env_var\n " ,
152- " type: haystack.components.generators.chat.hugging_face_local.HuggingFaceLocalChatGenerator\n " ,
155+ " tool_parsing_function: haystack_integrations.components.generators.transformers.chat.chat_generator.default_tool_parser\n " ,
156+ " tools: null\n " ,
157+ " type: haystack_integrations.components.generators.transformers.chat.chat_generator.TransformersChatGenerator\n " ,
158+ " connection_type_validation: true\n " ,
153159 " connections:\n " ,
154160 " - receiver: llm.messages\n " ,
155161 " sender: builder.prompt\n " ,
170176 "metadata" : {
171177 "id" : " 0C7zGsUCGszq"
172178 },
173- "source": "You should get a pipeline YAML that looks like the following:\n\n```yaml\ncomponents:\n builder:\n init_parameters:\n required_variables: null\n template:\n - _content:\n - text: '\n\n Please create a summary about the following topic:\n\n {{ topic }}\n\n '\n _meta: {}\n _name: null\n _role: user\n variables: null\n type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder\n llm:\n init_parameters:\n chat_template: null\n enable_thinking: false\n generation_kwargs:\n max_new_tokens: 150\n huggingface_pipeline_kwargs:\n device: cpu\n model: Qwen/Qwen2.5-1.5B-Instruct\n task: text-generation\n streaming_callback: null\n token:\n env_vars:\n - HF_API_TOKEN\n - HF_TOKEN\n strict: false\n type: env_var\n tool_parsing_function: haystack_integrations.components.generators.transformers.chat.chat_generator.default_tool_parser\n tools: null\n type: haystack_integrations.components.generators.transformers.chat.chat_generator.TransformersChatGenerator\nconnections:\n- receiver: llm.messages\n sender: builder.prompt\nmax_runs_per_component: 100\nmetadata: {}\n\n```"
179+ "source": "You should get a pipeline YAML that looks like the following:\n\n```yaml\ncomponents:\n builder:\n init_parameters:\n required_variables: null\n template:\n - content:\n - text: '\n\n Please create a summary about the following topic:\n\n {{ topic }}\n\n '\n meta: {}\n name: null\n role: user\n variables: null\n type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder\n llm:\n init_parameters:\n chat_template: null\n enable_thinking: false\n generation_kwargs:\n max_new_tokens: 150\n return_full_text: false\n stop_sequences: []\n huggingface_pipeline_kwargs:\n device: cpu\n model: Qwen/Qwen2.5-1.5B-Instruct\n task: text-generation\n streaming_callback: null\n token:\n env_vars:\n - HF_API_TOKEN\n - HF_TOKEN\n strict: false\n type: env_var\n tool_parsing_function: haystack_integrations.components.generators.transformers.chat.chat_generator.default_tool_parser\n tools: null\n type: haystack_integrations.components.generators.transformers.chat.chat_generator.TransformersChatGenerator\nconnection_type_validation: true\nconnections:\n- receiver: llm.messages\n sender: builder.prompt\nmax_runs_per_component: 100\nmetadata: {}\n\n```"
174180 },
175181 {
176182 "cell_type" : " markdown" ,
190196 "id" : " U332-VjovFfn"
191197 },
192198 "outputs" : [],
193- "source": "yaml_pipeline = \"\"\"\ncomponents:\n builder:\n init_parameters:\n template:\n - _content:\n - text: 'Please translate the following to French: \\n{{ sentence }}\\n'\n _meta: {}\n _name: null\n _role: user\n variables: null\n type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder\n llm:\n init_parameters:\n generation_kwargs:\n max_new_tokens: 150\n stop_sequences: []\n huggingface_pipeline_kwargs:\n device: cpu\n model: Qwen/Qwen2.5-1.5B-Instruct\n task: text-generation\n streaming_callback: null\n chat_template : \"{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}\"\n token:\n env_vars:\n - HF_API_TOKEN\n - HF_TOKEN\n strict: false\n type: env_var\n type: haystack_integrations.components.generators.transformers.chat.chat_generator.TransformersChatGenerator\nconnections:\n- receiver: llm.messages\n sender: builder.prompt\nmax_runs_per_component: 100\nmetadata: {}\n\"\"\""
199+ "source": "yaml_pipeline = \"\"\"\ncomponents:\n builder:\n init_parameters:\n required_variables: null\n template:\n - content:\n - text: 'Please translate the following to French: \\n{{ sentence }}\\n'\n meta: {}\n name: null\n role: user\n variables: null\n type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder\n llm:\n init_parameters:\n chat_template: \"{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}\"\n enable_thinking: false\n generation_kwargs:\n max_new_tokens: 150\n return_full_text: false\n stop_sequences: []\n huggingface_pipeline_kwargs:\n device: cpu\n model: Qwen/Qwen2.5-1.5B-Instruct\n task: text-generation\n streaming_callback: null\n token:\n env_vars:\n - HF_API_TOKEN\n - HF_TOKEN\n strict: false\n type: env_var\n tool_parsing_function: haystack_integrations.components.generators.transformers.chat.chat_generator.default_tool_parser\n tools: null\n type: haystack_integrations.components.generators.transformers.chat.chat_generator.TransformersChatGenerator\nconnection_type_validation: true\nconnections:\n- receiver: llm.messages\n sender: builder.prompt\nmax_runs_per_component: 100\nmetadata: {}\n\"\"\""
194200 },
195201 {
196202 "cell_type" : " markdown" ,
289295 },
290296 "nbformat" : 4 ,
291297 "nbformat_minor" : 0
292- }
298+ }
0 commit comments