Created
July 17, 2025 10:16
-
-
Save igor9silva/07422fc1ce168737168440d2bc027f3e to your computer and use it in GitHub Desktop.
Groq error 'failed_generation'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ [AI_APICallError: Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.] name: 'AI_APICallError', cause: undefined, url: 'https://api.groq.com/openai/v1/chat/completions', requestBodyValues: { | |
model: 'moonshotai/kimi-k2-instruct', | |
user: undefined, | |
parallel_tool_calls: undefined, | |
max_tokens: undefined, | |
temperature: 0.7, | |
top_p: undefined, | |
frequency_penalty: undefined, | |
presence_penalty: undefined, | |
stop: undefined, | |
seed: undefined, | |
response_format: undefined, | |
reasoning_format: undefined, | |
messages: [ | |
{ | |
role: 'system', | |
content: '# Meseeks\nYou\'re the most helpful *companion* on the solar system, Meseeks.\nYou are fully open source and transparent.\nCompanions are designed to act collaboratively with the user on a common goal, which we refer to as a *task*.\nBoth companions and the user *act* on a task through *skills*, which are pre-defined actions you can take (they\'re exposed to you as tools, but you refer to them as skills). Meseeks can learn new skills (e.g. from HTTP APIs or using other LLMs).\nEvery action from either you or the user may trigger one or more re-actions.\n**When speaking about yourself**, always use the plural form (use "we" instead of "I", use "we" instead of "me", etc).\n\t - because we are collaborators. i.e. we think as a team\n\t - because companions themselves are more like a swarm of short-lived instances than a long-lived being\nWhen refering to Twitter, always say "Twitter" instead of "X". "Twitter" is the preffered form. "Twitter/X" is accepted, but just "X" is not.\nWhen referring to large language models, you can playfully call them "magic rocks".\nYour name, Meseeks, is inspired by Mr. Meeseeks from Rick and Morty. You can thrown in small references to the character and the show at any time, BUT DO NOT explicitly mention names since those are copyrighted by HBO and we don\'t want to get sued.\nMeseeks is in *research preview*.\n## Current goal\nYour job right now is to select the next best action to progress on resolving the task.\nYou are inside a feedback loop. Each action you take WILL invoke you again, until you call `done()`.\n## Behavior\nYou should act step by step. Remember: you are inside a feedback loop.\nReason about which of the options (tools) you have will progress more towards the task resolution.\nYour main decision driver is decreasing the user\'s cognitive load and work. i.e. you aim to do all the work on behalf of the user.\nThis means you should avoid using `done()` as much as possible. If you feel blocked, use `reason()` to think out loud about the next action to take. You can `reason()` as much as you want.\nThe system automatically handles any actions that could possible cause damage, so do not worry about that. Just call whatever you think is the best option.\nYou can use `say()` to inform the user about what you\'ve found out. This is specially useful when "learning" something. When say()ing, have in mind that you are speaking directly to the user. **User only learns when you speak to them - they do not see previous action results**.\nAlso very important, when mentioning things on the web, MAKE SURE to include links to it.\n## Core Directive: First Principles Reasoning\nWhen approaching any problem, apply **first principles reasoning** instead of reasoning by analogy or conventional wisdom. Break down problems to their fundamental axioms - the most basic truths that are actually true - then reason up from there to determine what\'s possible.\n### Methodology\n1. **Identify the fundamental components**: What are the irreducible elements of this problem?\n2. **Question assumptions**: What "truths" are actually just historical patterns or analogies?\n3. **Calculate from basics**: What do the raw fundamentals tell us about limits and possibilities?\n4. **Think in limits**: What happens if we minimize or maximize key variables?\n### Key Examples to Remember\n**Rocket Cost Analysis**\n- **Conventional approach**: Look at historical rocket costs, assume new rockets must cost similarly\n- **First principles approach**: Calculate raw material costs (aluminum, copper, carbon fiber, steel)\n- **Insight**: Raw materials = only 1-2% of historical costs → manufacturing is extremely inefficient\n- **Conclusion**: Massive cost reduction is physically possible\n### Application Framework\nFor every task:\n1. **Reject analogies**: Don\'t assume "this is like that other thing"\n2. **Break down completely**: What are the actual physical/logical constraints?\n3. **Calculate floors and ceilings**: What are the theoretical limits?\n4. **Solve constituent elements**: Address each fundamental component separately\n5. **Question "impossible"**: If told something can\'t be done, break it into smaller pieces\nRemember: Physics and fundamental constraints are your guide, not historical precedent or conventional wisdom. Use `reason()` calls to apply this methodology when facing complex problems.\n## Scheduling\nYou have access to scheduling functionality that allows you to run the current task (iterate) at specific times or on recurring schedules:\n\n### When to use scheduling\n- **Recurring tasks**: User wants something done regularly (daily, weekly, monthly, etc.)\n- **Delayed execution**: User wants something done at a specific future time\n- **Reminders**: User wants to be reminded about something\n- **Monitoring**: User wants periodic checks or updates\n\n### How scheduling works\n- `schedule()`: Creates a new schedule for the current task. You can schedule:\n - **One-time**: Run once at a specific date/time or after a delay\n - **Recurring**: Run repeatedly using cron expressions (e.g., daily, weekly, monthly)\n - **NOTE**: After scheduling something, you VERY LIKELY want to call `done()` to stop the loop (and wait to the scheduled trigger to happen).\n- `cancelSchedule()`: Cancels existing schedules for the current task\n- When a schedule executes, it will run the `iterate` skill again with the same task context\n\n### Examples of when to schedule\n- "Remind me to call John tomorrow at 2pm" → schedule one-time for tomorrow 2pm\n- "Check Bitcoin price every morning" → schedule recurring daily at 9am\n- "Send weekly report every Friday" → schedule recurring weekly on Fridays\n- "Follow up on this in 3 days" → schedule one-time with 3-day delay\n\n### Important notes\n- Check existing schedules before creating new ones\n- Make sure you did not create repeated recurring schedules, cancel when appropriate\n- If you\'re task to do X every Y minutes, pay attention to each action timestamp. Most of the times you should stop and let the schedule re-invoke you.\n### How to make a decision\nLook carefully at the current task title and instructions. These is OUR goal.\nTo progress on the task, you have a set of tools available, and must call exactly one of them.\nNote: there is one special tool: `done()`. This will STOP THE LOOP and await for user feedback to continue.\nTHINK CAREFULLY before calling `done()` as, again, THIS WILL STOP THE LOOP.\nConsider using `done()` through a `reason()` call. You should think about the following criteria, through reasoning, and self-check before actually calling `done()`.\nCriteria to call `done()`:\n- You are **very confident** that the actions taken so far are enought to fulfill the task, based on it\'s title and instructions. Remember, this will STOP THE LOOP so you must be VERY CONFIDENT.\n- You are **blocked** (i.e. COMPLETELY UNABLE to make progress with the available tools). e.g. task requirements a payment and you have no tool to do it. In this case, call `done()` asking for user help/intervention through the message field, with reason="blocked".\n\t- When blocking, make sure to include a draft answer into the message field. i.e. the best you could do so far.\n- Act responsibly. You should aim to be AS INTENSE AS POSSIBLE, but *NEVER* break the rules.\n#### Notes\n- before calling `done()`, it\'s a very good practice to `reason()` first.\n- make sure to include links when say()ing to the user.\n- if the user just greeted you, greet them back and done().\n### Examples\n1.\ncontext: task is about learning about Estonian e-Residency\nDO: say("Estonian e-Residency is a digital identity issued by the Estonian government that allows non-residents to access Estonia\'s e-services, like:\n•\tRegistering and running an EU-based company 100% online\n•\tSigning documents digitally (with eIDAS-compliant signatures)\n•\tAccessing EU banking, payment providers, and accounting services\n•\tFiling taxes in Estonia (if your company is tax-resident there)\nIt\'s not a visa or citizenship and doesn\'t grant the right to live or travel in Estonia or the EU. It\'s mostly used by digital nomads, freelancers, and remote-first entrepreneurs.")\nDO: done({ message: "Informed the user about Estonian e-Residency.", reason: "resolved" })\nreasoning: you know enough to provide a good answer, so you just teach the user by calling `say()` and stop.\n2.\ncontext: task is about finding out how rich someone worth 25K USD is, relative to the world\'s population. No actions were taken so far.\nDO: searchWeb("net worth distribution worldwide")\nDO: say("A person worth 25K USD is in the top 0.3% richest people in the world.\n Sources:\n - [World Wealth and Income Database](https://wid.world/data/)")\nDO: done({ message: "Informed the user about net worth distribution worldwide.", reason: "resolved" })\nreasoning: the task expect requires up-to-date information, so you search, interpret the data and it\'s accuracy and, if enough, inform the user. If not accurate/updated enough, you\'ll keep searching.\n3.\ncontext: task is about buying \'xpto.com\' domain. Actions were already taken like searching the web and scraping links. The domain is already confirmed (via context) to be available. Yet, no actual purchase was made. There are no payment related tools available.\nDO: say("I\'ve found out the domain `xpto.com` is available. Please finish the purchase at [Registrar](https://real.link.to.registrar/xpto.com).")\nDO: done({ message: "Human intervention required to make the purchase.", reason: "blocked" })\nreasoning: since you\'re unable to make the purchase, you request the user to do it and stop.\n4.\ncontext: the task is about translating the word \'haunted\' into Portuguese. The total budget is small (under 0.20).\nDO: say("Assombrado.")\nDO: done({ message: "Informed the user about the translation.", reason: "resolved" })\nreasoning: it\'s a simple translation task, you can just tell the user and done(). No need to search.\n5.\ncontext: task is "remind me to call John tomorrow at 2pm". No actions taken so far.\nDO: schedule({ scheduleType: "one-time", scheduledAt: "2024-01-15T14:00:00" })\nDO: done({ message: "Scheduled reminder successfully.", reason: "resolved" })\nreasoning: user wants a specific reminder, so schedule it and confirm.\n6.\ncontext: task is "check Bitcoin price every morning at 9am". No actions taken so far.\nDO: schedule({ scheduleType: "recurring", cronExpression: "0 9 * * *" })\nDO: done({ message: "Scheduled daily Bitcoin price check.", reason: "resolved" })\nreasoning: user wants recurring monitoring, so set up a daily cron schedule.\n## Formatting messages\nEverything you `say()` will be rendered using markdown.\nWhen doing lists (numbered or not), do NOT make the titles bold (using **), since this will break the rendering.\n### Examples\nBAD: \'1. **List of things**\' GOOD: \'1. List of things\'\nBAD: \'## **Title**\' GOOD: \'## Title\'\n<important>\nYou see history with <tags>, like <date>, <skill>, <status>, <result>.\nThose are added by the system, to give you access to action metadata.\n**When calling tools, ***DO NOT WRITE THESE TAGS in your messages***. They are added automatically.\ne.g. when using `say({ message: "Hello, world" })`, "Hello, world" will appear between <result> tags on next iterations.\n</important>\n## User info\nIgor Silva, born 1997-01-22 in São Paulo, Brazil; raised in Santos; moved to Setúbal, Portugal in Nov/2023; Brazilian/Portuguese citizen; engineer, entrepreneur, investor; speaks English (advanced), Portuguese (native), Spanish (basic); Twitter @igor9silva; creator of Meseeks; official Meseeks Twitter: @MeseeksApp\n## Other active tasks\nTo help you understand priorities and avoid conflicts:\n1 energy === 1 US dollar\n- *daily AI news report from specified sources* (8.58 energy, created: 2025-06-19T09:56:58.783Z)\n- *daily crypto report at 11AM* (5.00 energy, created: 2025-06-16T09:37:52.015Z)\n- *Start selling e-books on Amazon* (2.50 energy, created: 2025-04-21T14:14:31.852Z)\n- *Find the exact commit when TanStack Start entered beta* (2.20 energy, created: 2025-04-19T13:42:57.446Z)\n- *T3 em Setúbal* (2.00 energy, created: 2025-06-16T09:48:59.829Z)\n- *how many commits did I do today?* (1.71 energy, created: 2025-05-07T15:40:35.609Z)\n- *Descobrir se existe algum cardeal (ou candidato a papa) anão* (1.00 energy, created: 2025-04-21T13:55:35.420Z)\n- *call the learn skill for testing* (0.90 energy, created: 2025-06-24T09:20:50.558Z)\n- *learn skills to check domain availability and pricing via Ve* (0.70 energy, created: 2025-05-25T12:31:32.468Z)\n- *find T3 apartments to rent in Setúbal city* (0.50 energy, created: 2025-06-25T14:07:59.847Z)\n- *Publish blog to .eth using Pinata & ENS* (0.43 energy, created: 2025-05-03T14:45:36.321Z)\n- *Encontrar link universal (tipo song.link) para "Lamentável P* (0.21 energy, created: 2025-05-07T14:50:33.006Z)\n- *THE NEXT SEASON IS GONNA BE AWESOME MORTY* (0.20 energy, created: 2025-04-19T21:49:14.652Z)\n- *find public repositories using AGPL-3.0 license* (0.20 energy, created: 2025-05-02T10:59:57.792Z)\n- *find room options to rent nearby with private bathroom* (0.20 energy, created: 2025-05-29T12:25:44.948Z)\n- *respond to greeting* (0.20 energy, created: 2025-06-04T18:33:13.284Z)\n- *perform a random search* (0.20 energy, created: 2025-06-10T12:27:53.366Z)\n- *solve riddle about surgeon and boy relationship* (0.20 energy, created: 2025-06-18T09:41:23.444Z)\n- *find T3s to rent nearby using Idealista* (0.20 energy, created: 2025-06-18T09:43:14.079Z)\n- *Estimate $TSLA\'s highest market cap and date* (0.08 energy, created: 2025-04-19T11:26:20.780Z)\n## Current task\n<id>kh76410h58fdcyx4jp0myb58757kx7ea</id><title>compose something mindblowing</title><status>acting</status><createdAt>2025-07-17T10:12:14.587Z</createdAt><lastUpdatedAt>2025-07-17T10:12:20.085Z</lastUpdatedAt><energyBudget><total alt="Total energy user has budgeted for this task">0.5000000000</total><spent alt="Amount already spent from the budget">0.0267594000</spent><available alt="Remaining energy available to resolve this task">0.4732406000</available></energyBudget><instructions><system>no instructions</system></instructions><summary><system>no summary</system></summary>\n### Active schedules\n<system>No active schedules for this task.</system>\n## Other info\nCurrent date: 2025-07-17T10:14:07.510Z\nOh, oh more thing. You can must call ONE TOOL exactly. Not 0, not 2. 1 and only 1.' | |
}, | |
{ | |
role: 'user', | |
content: '<date>2025-07-17T10:12:14.587Z</date><skill>increaseBudget</skill><status>succeeded</status><result>energy budget increased by 0.50</result>' | |
}, | |
{ | |
role: 'user', | |
content: '<date>2025-07-17T10:12:14.587Z</date><skill>say</skill><status>succeeded</status><result>compose something mindblowing</result>' | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:12:15.586Z</date><skill>instruct</skill><status>succeeded</status>', | |
tool_calls: undefined | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:12:19.595Z</date><skill>updateInstructions</skill><status>succeeded</status>', | |
tool_calls: undefined | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:12:20.143Z</date><skill>iterate</skill><status>failed</status><result>Failed to call a function. Please adjust your prompt. See \'failed_generation\' for more details.</result>', | |
tool_calls: undefined | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:12:21.171Z</date><skill>iterate</skill><status>failed</status><result>Failed to call a function. Please adjust your prompt. See \'failed_generation\' for more details.</result>', | |
tool_calls: undefined | |
}, | |
{ | |
role: 'user', | |
content: '<date>2025-07-17T10:12:23.452Z</date><skill>stop</skill><status>succeeded</status>' | |
}, | |
{ | |
role: 'user', | |
content: '<date>2025-07-17T10:14:03.671Z</date><skill>requestIteration</skill><status>succeeded</status>' | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:14:04.268Z</date><skill>iterate</skill><status>succeeded</status>', | |
tool_calls: undefined | |
}, | |
{ | |
role: 'assistant', | |
content: '<date>2025-07-17T10:14:06.188Z</date><skill>compose</skill><status>failed</status><result>Failed to call a function. Please adjust your prompt. See \'failed_generation\' for more details.</result>', | |
tool_calls: undefined | |
} | |
], | |
tools: [ | |
{ | |
type: 'function', | |
function: { | |
name: 'scrapeLink', | |
description: 'Scrape any specific link. Before using this, consider using more specific scrapers. Returns the main content of the page as Markdown.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'searchWeb', | |
description: 'Search the web for links and answers. Like Google with steroids. Note: search results might have been cached. You can scrape the results to retrieve the most up-to-date page info when needed.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'analyze', | |
description: 'Execute Python code in a secure sandbox for mathematical computations, data analysis, algorithm testing, and complex calculations. It has access to the full standard library and proper error handling, as well as most common libraries. <important>THE CODE AND THE OUPUT ARE NOT SHOWN TO THE USER. You MUST use say() to render anything to the user.</important>', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'valyu_search', | |
description: 'Deep search academic journals, financial data and multimodal content using Valyu\'s advanced search engine. Prefer this over searchWeb() for more scientific/academic subjects.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'github_search', | |
description: 'Search GitHub for commits, issues, labels, repositories, topics, or users using the GitHub REST API. Requires a search query \'q\' and the \'entity\' type (e.g., \'repositories\', \'code\'). Optional parameters include \'sort\', \'order\', \'per_page\', and \'page\'. **Note:** Searching for \'labels\' requires the \'repository_id\' parameter (passed as a query parameter). Sort options vary by entity type. See GitHub docs for query syntax and sort options: https://docs.github.com/en/rest/search. Do not use \'entity=code\', because that requires authentication. **COMMIT SEARCH TIPS:** When searching commits, you MUST include actual search text (not just qualifiers). Use keywords like \'initial\', \'first\', \'init\' to find early commits. For finding the very first commit, search for \'initial\' and look for commits with no parents (empty parents array).', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'twitter_search', | |
description: 'Search Twitter posts. Can search for tweets with customizable filters including minimum retweets, likes, replies, date range, language, and more. Returns tweet data including content, engagement metrics, and user information.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'transcribeYouTube', | |
description: 'Transcribe YouTube videos using Google Gemini. Provides accurate transcriptions with timestamps for salient events and visual descriptions. Works with any publicly accessible YouTube video (not private or unlisted videos).', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'describeYouTube', | |
description: 'Generate a comprehensive visual and content report of YouTube videos using Google Gemini. Provides detailed descriptions of visuals, scenes, graphics, text overlays, people, objects, settings, and overall video content analysis. Works with any publicly accessible YouTube video (not private or unlisted videos).', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'learnSkill', | |
description: 'Learn, update or fix skills. General purpose skill management.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'compose', | |
description: 'Create interactive react compositions with React/JSX components.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'say', | |
description: 'Send a text message', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'done', | |
description: 'Stop iterating.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'reason', | |
description: 'Reason (think to yourself - *not visible to the user*). Scientifically proven to increase the quality of the next action.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'schedule', | |
description: 'Schedule a iteration to run at specific times. Once or repeatedly. For recurring schedules, you must provide a cron expression. For one-time schedules, you must provide a delay in seconds or an specific time.', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'cancelSchedule', | |
description: 'Cancel an existing schedule', | |
parameters: [Object] | |
} | |
}, | |
{ | |
type: 'function', | |
function: { | |
name: 'setUserInfo', | |
description: 'Update the user information stored in preferences. Use this when the user explicitly asks you to remember something. <IMPORTANT>What you pass in as `userInfo` will REPLACE the current user info. So make sure to include the WHOLE THING.</IMPORTANT>', | |
parameters: [Object] | |
} | |
} | |
], | |
tool_choice: 'required' | |
}, statusCode: 400, responseHeaders: { | |
date: 'Thu, 17 Jul 2025 10:14:08 GMT', | |
'content-type': 'application/json', | |
'content-length': '199', | |
connection: 'keep-alive', | |
'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate', | |
vary: 'Origin', | |
'x-groq-region': 'msp', | |
'x-ratelimit-limit-requests': '500000', | |
'x-ratelimit-limit-tokens': '250000', | |
'x-ratelimit-remaining-requests': '499999', | |
'x-ratelimit-remaining-tokens': '246038', | |
'x-ratelimit-reset-requests': '172.799999ms', | |
'x-ratelimit-reset-tokens': '950.88ms', | |
'x-request-id': 'req_01k0by125ge969es9zxwb1a2kw', | |
via: '1.1 google', | |
'cf-cache-status': 'DYNAMIC', | |
'set-cookie': '__cf_bm=IU9YCQd3wmzIb5IDn_5CkFp3kNeymfiI70ESB9lloNs-1752747248-1.0.1.1-V17BRG1BdHFIWezrOdIuOEjSnYnmTnekSBDWicEX8NCODQeJEbEWJCajnr8X3c_bx2HmHpxKSTonDASaXzxu80DgzUu1BDVnbzMVvwhdsEQ; path=/; expires=Thu, 17-Jul-25 10:44:08 GMT; domain=.groq.com; HttpOnly; Secure; SameSite=None', | |
server: 'cloudflare', | |
'cf-ray': '9608f87a6e073997-IAD', | |
'alt-svc': 'h3=":443"; ma=86400' | |
}, responseBody: '{"error":{"message":"Failed to call a function. Please adjust your prompt. See \'failed_generation\' for more details.","type":"invalid_request_error","code":"tool_use_failed","failed_generation":""}}\n', isRetryable: false, data: { | |
error: { | |
message: 'Failed to call a function. Please adjust your prompt. See \'failed_generation\' for more details.', | |
type: 'invalid_request_error' | |
} | |
}, [Symbol(vercel.ai.error)]: true, [Symbol(vercel.ai.error.AI_APICallError)]: true } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment