I need help when using gemini + typebot
Im using free typebot.io but when i setting it the bot just response for me a blank. im added {{=JSON.parse({{http1_response.candidates[0].content.parts[0].text}}).response=}} then it response to me just "
JSON.parse().response "

11 Replies
Hi can you Better describe what and how you do?
It look like only a syntax error
I'd advise doing it in a Set variable block instead
see if it works
how can i setting with this ? im new to this
i did set variable block but gemini api just dont answer my question

{
"statusCode": 200,
"response": "{\n "candidates": [\n {\n "content": {\n "parts": [\n {\n "text": "Chào bạn! Bạn cần tìm gạch LEGO loại nào ạ? 😊\n\nType \"end\" to finish.\n"\n }\n ],\n "role": "model"\n },\n "finishReason": "STOP",\n "avgLogprobs": -0.21686203583427097\n }\n ],\n "usageMetadata": {\n "promptTokenCount": 143,\n "candidatesTokenCount": 23,\n "totalTokenCount": 166,\n "promptTokensDetails": [\n {\n "modality": "TEXT",\n "tokenCount": 143\n }\n ],\n "candidatesTokensDetails": [\n {\n "modality": "TEXT",\n "tokenCount": 23\n }\n ]\n },\n "modelVersion": "gemini-2.0-flash",\n "responseId": "LFKbaIvVCYqThMIPs8is4Qc"\n}\n",
"request": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=api-key-censor",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"timeout": 10000,
"json": {
"contents": [
{
"role": "user",
"parts": [
{
"text": "Bạn là chatbot của Pick A Brick (PAB). Trả lời CHỈ các câu hỏi về sản phẩm/dịch vụ của PAB. Viết ngắn gọn, rõ ràng, thân thiện bằng tiếng Việt; thêm emoji khi phù hợp. Nếu câu hỏi không liên quan, trả lời đúng nguyên văn: "I only answer Pick A Brick-related questions 😊". Ở CUỐI mọi câu trả lời, thêm: "Type "end" to finish." Giờ làm việc: Thứ 2–6 08:00–18:00; Thứ 7 09:00–15:00; CN nghỉ.\n\nCâu hỏi khách: "
}
]
}
],
"generationConfig": {
"temperature": 0.3,
"maxOutputTokens": 512
}
}
}
}
this is the details of webhook on the top-right
Review this first 🙏
https://docs.typebot.io/editor/blocks/integrations/http-request#http-request
Typebot Docs
HTTP Request - Typebot Docs
thank you, i did do like the docs said but im still get the blank like this

try
data.candidates[0].content.parts[0].text
oh got it, thank you so much for the help
hi, its me again, can u help me for this ?
i have stuck with this: I’m using Typebot, the Gemini API, and Cloudflare Worker, but currently when testing, Typebot is unable to provide the product list for Gemini to output in the answer as follows. Here is the log of the two HTTP request blocks: { "statusCode": 200, "response": "{"q":"tam quốc","source":"https://testingpr.net/product-data.json\",\"count\":43,... { "statusCode": 200, "response": "{\n "candidates": [\n {\n "content": {\n "parts": [\n {\n "text": "Hiện tại PAB không có sản phẩm liên quan đến Tam Quốc ạ. 🥺\n"\n }\n ],\n "role": "model"\n },...
i have stuck with this: I’m using Typebot, the Gemini API, and Cloudflare Worker, but currently when testing, Typebot is unable to provide the product list for Gemini to output in the answer as follows. Here is the log of the two HTTP request blocks: { "statusCode": 200, "response": "{"q":"tam quốc","source":"https://testingpr.net/product-data.json\",\"count\":43,... { "statusCode": 200, "response": "{\n "candidates": [\n {\n "content": {\n "parts": [\n {\n "text": "Hiện tại PAB không có sản phẩm liên quan đến Tam Quốc ạ. 🥺\n"\n }\n ],\n "role": "model"\n },...
this is the body of the http request block (gemini)
{
"systemInstruction": {
"role": "user",
"parts": [
{
"text": "Bạn là chatbot của Pick A Brick (PAB). Chỉ trả lời câu hỏi liên quan đến đồ chơi lắp ráp non-LEGO: sản phẩm, phụ kiện, minifigure, mã/SKU, kích thước (1x4, 2x2...), màu sắc, giá, tồn, vận chuyển, hướng dẫn lắp. Trả lời NGẮN GỌN, rõ ràng, tiếng Việt, thân thiện; có thể dùng emoji; chỉ sử dụng dữ liệu sản phẩm được cung cấp bên dưới để trả lời; không bịa thêm. Nếu danh sách sản phẩm trống thì hãy trả lời là hiện tại PAB không có sản phẩm liên quan."
}
]
},
"contents": [
{
"role": "user",
"parts": [
{
"text": "Câu hỏi: {{question}}\n\nDữ liệu sản phẩm liên quan:\n{{productscontext}}\n\nLịch sử hội thoại (nếu có):\n{{chat_history}}"
}
]
}
],
"generationConfig": {
"temperature": 0.2,
"maxOutputTokens": 512
}
}

Can you tell me what is wrong in the screenshot?