Skip to content

Commit

Permalink
groq: typing/ruff lint, require recent version
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 10, 2024
1 parent 2f2891e commit 7946349
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [time_limit](https://inspect.ai-safety-institute.org.uk/errors_and_limits.html#sec-sample-limits) option for specifying a maximum execution time for samples.
- [read_eval_log_samples()](https://inspect.ai-safety-institute.org.uk/eval-logs.html#streaming) function for streaming reads of `.eval` log files.
- Mistral: Support for multi-modal models (requires v1.2 of mistralai package).
- Groq: Support for multi-modal models (requires v0.11.0 of groq package).
- AzureAI: Use Model Inference API (preview) for implementation of model client.
- Bedrock: Fix parsing of Bedrock Mistral Large 2407 responses
- Apply standard sample error handling (fail-on-error, etc.) when running scorers.
Expand Down
11 changes: 5 additions & 6 deletions src/inspect_ai/model/_providers/groq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import os
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Literal, Optional, cast

from groq import (
AsyncGroq,
Expand Down Expand Up @@ -213,10 +213,7 @@ async def groq_chat_message(message: ChatMessage) -> ChatCompletionMessageParam:
content = (
message.content
if isinstance(message.content, str)
else [
await as_chat_completion_part(content)
for content in message.content
]
else [await as_chat_completion_part(content) for content in message.content]
)
return ChatCompletionUserMessageParam(role="user", content=content)

Expand Down Expand Up @@ -262,7 +259,9 @@ async def as_chat_completion_part(

return ChatCompletionContentPartImageParam(
type="image_url",
image_url=dict(url=image_url, detail=detail),
image_url=dict(
url=image_url, detail=cast(Literal["auto", "low", "high"], detail)
),
)


Expand Down
2 changes: 1 addition & 1 deletion src/inspect_ai/model/_providers/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def groq() -> type[ModelAPI]:
FEATURE = "Groq API"
PACKAGE = "groq"
MIN_VERSION = "0.1.0"
MIN_VERSION = "0.11.0"

# verify we have the package
try:
Expand Down

0 comments on commit 7946349

Please sign in to comment.