-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Shulin-Zhang/add-tongyi
- Loading branch information
Showing
60 changed files
with
5,521 additions
and
2,071 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
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 |
---|---|---|
|
@@ -4,3 +4,12 @@ __pycache__/ | |
env/ | ||
.env | ||
.google-adc | ||
|
||
# Testing | ||
.coverage | ||
|
||
# pyenv | ||
.python-version | ||
|
||
.DS_Store | ||
**/.DS_Store |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
from .client import Client | ||
from .framework.message import Message | ||
from .utils.tool_manager import Tools |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .provider_interface import ProviderInterface | ||
from .chat_completion_response import ChatCompletionResponse | ||
from .message import Message |
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
from aisuite.framework.message import Message | ||
from typing import Literal, Optional | ||
|
||
|
||
class Choice: | ||
def __init__(self): | ||
self.message = Message() | ||
self.finish_reason: Optional[Literal["stop", "tool_calls"]] = None | ||
self.message = Message( | ||
content=None, tool_calls=None, role="assistant", refusal=None | ||
) |
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 |
---|---|---|
@@ -1,6 +1,22 @@ | ||
"""Interface to hold contents of api responses when they do not conform to the OpenAI style response""" | ||
"""Interface to hold contents of api responses when they do not confirm to the OpenAI style response""" | ||
|
||
from pydantic import BaseModel | ||
from typing import Literal, Optional | ||
|
||
class Message: | ||
def __init__(self): | ||
self.content = None | ||
|
||
class Function(BaseModel): | ||
arguments: str | ||
name: str | ||
|
||
|
||
class ChatCompletionMessageToolCall(BaseModel): | ||
id: str | ||
function: Function | ||
type: Literal["function"] | ||
|
||
|
||
class Message(BaseModel): | ||
content: Optional[str] | ||
tool_calls: Optional[list[ChatCompletionMessageToolCall]] | ||
role: Optional[Literal["user", "assistant", "system"]] | ||
refusal: Optional[str] |
Oops, something went wrong.