Skip to content

Commit

Permalink
combine user and assistant messages for vertex models (#199)
Browse files Browse the repository at this point in the history
Co-authored-by: aisi-inspect <[email protected]>
  • Loading branch information
jjallaire-aisi and aisi-inspect authored Aug 6, 2024
1 parent ab317ff commit fd87755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 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 @@
- Improved metrics `value_to_float` string conversion (handle numbers, "true", "false", etc.)
- Log viewer: Ctrl/Cmd+F to find text when running in VS Code.
- Set Claude default `max_tokens` to 4096
- Combine user and assistant messages for Vertex models.

## v0.3.20 (03 August 2024)

Expand Down
8 changes: 8 additions & 0 deletions src/inspect_ai/model/_providers/vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ def connection_key(self) -> str:
"""Scope for enforcing max_connections (could also use endpoint)."""
return self.model_name

@override
def collapse_user_messages(self) -> bool:
return True

@override
def collapse_assistant_messages(self) -> bool:
return True


async def as_chat_messages(messages: list[ChatMessage]) -> list[Content]:
# google does not support system messages so filter them out to start with
Expand Down

0 comments on commit fd87755

Please sign in to comment.