groq / groq-typescript

The official Node.js / Typescript library for the Groq API
Apache License 2.0
126 stars 17 forks source link

Tools use in groq for llama 70b #28

Open suhail-ak-2 opened 1 month ago

suhail-ak-2 commented 1 month ago

When i am trying to use tools in chat completions.create it is throwing error tool_use_failed

{ status: 400, headers: { "alt-svc": "h3=\":443\"; ma=86400", "cache-control": "private, max-age=0, no-store, no-cache, must-revalidate", "cf-cache-status": "DYNAMIC", "cf-ray": "8828f41b9aba80aa-BOM", connection: "keep-alive", "content-length": "485", "content-type": "application/json", date: "Sun, 12 May 2024 08:14:11 GMT", server: "cloudflare", "set-cookie": "__cf_bm=ccxrHjgy0_PUYCffImbz6rYU7nDeB9ExZdr7BeaeQeY-1715501651-1.0.1.1-aXswIp5azR1XrH9WQMjvnTIDTEh7t30bFwHM5e8DVxfvgJW9T5OeluW5RL5TMMJJHLselQgF9jyNsxTGhujeow; path=/; expires=Sun, 12-May-24 08:44:11 GMT; domain=.groq.com; HttpOnly; Secure; SameSite=None", vary: "Origin", via: "1.1 google", "x-ratelimit-limit-requests": "14400", "x-ratelimit-limit-tokens": "6000", "x-ratelimit-remaining-requests": "14399", "x-ratelimit-remaining-tokens": "5843", "x-ratelimit-reset-requests": "6s", "x-ratelimit-reset-tokens": "1.57s", "x-request-id": "req_01hxnxvkfjf6ttkqzfpw23ng08", }, error: { 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{\n \"tool_calls\": [\n {\n \"id\": \"pending\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"pms\"\n },\n \"parameters\": {\n \"jobCategory\": \"ENGINE\",\n \"jobTitle\": \"DECARB STATUS\"\n }\n }\n ]\n}\n```", }, }, }

juandavidGF commented 3 weeks ago

were you able to fix it? or find out how it works?