Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidando73 committed Jan 3, 2025
1 parent d913fbe commit a230008
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llama_stack/providers/remote/inference/groq/groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ async def chat_completion(
)
)

try:
try:
response = self._get_client().chat.completions.create(**request)
except groq.BadRequestError as e:
if e.body.get("error", {}).get("code") == "tool_use_failed":
# For smaller models, Groq may fail to call a tool even when the request is well formed
raise ValueError("Groq failed to call a tool", e.body.get("error", {}))
raise ValueError(
"Groq failed to call a tool", e.body.get("error", {})
) from e
else:
raise e

Expand Down

0 comments on commit a230008

Please sign in to comment.