Skip to content

Commit

Permalink
update agent
Browse files Browse the repository at this point in the history
  • Loading branch information
qingzhong1 committed Jan 2, 2024
1 parent d0bdcee commit 728bcdf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from erniebot_agent.tools.base import Tool
from erniebot_agent.tools.schema import ToolParameterView

from .utils import access_token

TOKEN_MAX_LENGTH = 4800


Expand All @@ -34,7 +32,7 @@ class TextSummarizationTool(Tool):
ouptut_type: Type[ToolParameterView] = TextSummarizationToolOutputView

def map_reduce(self, question: str = ""):
llm = ErnieBot(aistudio_access_token=access_token)
llm = ErnieBot()
document_prompt = PromptTemplate.from_template("{page_content}")
partial_format_document = partial(format_document, prompt=document_prompt)
prompt = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
from erniebot_agent.retrieval.document import Document

api_type = os.environ.get("api_type", None)
access_token = os.environ.get("access_token", None)


def erniebot_chat(messages: list, functions: Optional[str] = None, model: Optional[str] = None, **kwargs):
if not model:
model = "ernie-4.0"
_config = dict(
api_type=api_type,
access_token=access_token,
)
if functions is None:
resp_stream = erniebot.ChatCompletion.create(
Expand Down

0 comments on commit 728bcdf

Please sign in to comment.