-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support config temperature in bot
fix: lint
- Loading branch information
Showing
7 changed files
with
128 additions
and
85 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 |
---|---|---|
@@ -1,29 +1,30 @@ | ||
|
||
from abc import abstractmethod | ||
from typing import Any, Dict, List, Optional | ||
from langchain_core.language_models import BaseChatModel | ||
|
||
from petercat_utils.data_class import MessageContent | ||
|
||
class BaseLLMClient(): | ||
def __init__(self, | ||
temperature: Optional[int] = 0.2, | ||
max_tokens: Optional[int] = 1500, | ||
streaming: Optional[bool] = False, | ||
api_key: Optional[str] = '' | ||
): | ||
pass | ||
|
||
@abstractmethod | ||
def get_client() -> BaseChatModel: | ||
pass | ||
|
||
@abstractmethod | ||
def get_tools(self, tool: List[Any]) -> list[Dict[str, Any]]: | ||
pass | ||
|
||
@abstractmethod | ||
def parse_content(self, content: List[MessageContent]) -> List[MessageContent]: | ||
pass | ||
|
||
|
||
class BaseLLMClient: | ||
def __init__( | ||
self, | ||
temperature: Optional[float] = 0.2, | ||
n: Optional[int] = 1, | ||
top_p: Optional[float] = None, | ||
max_tokens: Optional[int] = 1500, | ||
streaming: Optional[bool] = False, | ||
api_key: Optional[str] = "", | ||
): | ||
pass | ||
|
||
@abstractmethod | ||
def get_client() -> BaseChatModel: | ||
pass | ||
|
||
@abstractmethod | ||
def get_tools(self, tool: List[Any]) -> list[Dict[str, Any]]: | ||
pass | ||
|
||
@abstractmethod | ||
def parse_content(self, content: List[MessageContent]) -> List[MessageContent]: | ||
pass |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import json | ||
from typing import List, Optional | ||
|
||
from github import Github | ||
|
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