-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds support for anthropic models to Explorer assistant (#273)
- Loading branch information
Showing
79 changed files
with
6,844 additions
and
869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .response import respond_to_conversation | ||
|
||
__all__ = ["respond_to_conversation"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from typing import Any, Protocol, Sequence | ||
|
||
from assistant_extensions.ai_clients.model import CompletionMessage | ||
from attr import dataclass | ||
from semantic_workbench_api_model.workbench_model import ( | ||
MessageType, | ||
) | ||
|
||
|
||
@dataclass | ||
class NumberTokensResult: | ||
count: int | ||
metadata: dict[str, Any] | ||
metadata_key: str | ||
|
||
|
||
@dataclass | ||
class ResponseResult: | ||
content: str | None | ||
message_type: MessageType | ||
metadata: dict[str, Any] | ||
completion_total_tokens: int | ||
|
||
|
||
class ResponseProvider(Protocol): | ||
async def get_response( | ||
self, | ||
messages: list[CompletionMessage], | ||
metadata_key: str, | ||
) -> ResponseResult: ... | ||
|
||
async def num_tokens_from_messages( | ||
self, | ||
messages: Sequence[CompletionMessage], | ||
model: str, | ||
metadata_key: str, | ||
) -> NumberTokensResult: ... |
Oops, something went wrong.