mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 09:21:45 +00:00
.
This commit is contained in:
parent
d913fbeafe
commit
a230008d08
1 changed files with 4 additions and 2 deletions
|
@ -125,12 +125,14 @@ class GroqInferenceAdapter(Inference, ModelRegistryHelper, NeedsRequestProviderD
|
|||
)
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue