-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #896 from Undertone0809/v1.18.3/change-storage-path
feat: Add new beta test file for streamlit sidebar
- Loading branch information
Showing
40 changed files
with
1,240 additions
and
1,141 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
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
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
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,48 +1,55 @@ | ||
aiohttp==3.9.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
aiohappyeyeballs==2.4.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
aiohttp==3.10.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
aiosignal==1.3.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
annotated-types==0.7.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
anyio==4.4.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
async-timeout==4.0.3 ; python_full_version >= "3.8.1" and python_version < "3.11" | ||
attrs==23.2.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
attrs==24.2.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
broadcast-service==1.3.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
certifi==2024.6.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
certifi==2024.8.30 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
charset-normalizer==3.3.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
click==8.1.7 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
colorama==0.4.6 ; python_full_version >= "3.8.1" and python_version < "4.0" and platform_system == "Windows" | ||
cushy-storage==1.3.8 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
distro==1.9.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
exceptiongroup==1.2.1 ; python_full_version >= "3.8.1" and python_version < "3.11" | ||
filelock==3.14.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
exceptiongroup==1.2.2 ; python_full_version >= "3.8.1" and python_version < "3.11" | ||
filelock==3.15.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
frozenlist==1.4.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
fsspec==2024.6.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
fsspec==2024.9.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
h11==0.14.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
httpcore==1.0.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
httpx==0.27.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
huggingface-hub==0.23.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
idna==3.7 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
importlib-metadata==7.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
httpx==0.27.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
huggingface-hub==0.24.6 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
idna==3.8 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
importlib-metadata==8.4.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
importlib-resources==6.4.4 ; python_full_version >= "3.8.1" and python_version < "3.9" | ||
jinja2==3.1.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
litellm==1.40.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
jiter==0.5.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
jsonschema-specifications==2023.12.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
jsonschema==4.23.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
litellm==1.44.19 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
markupsafe==2.1.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
multidict==6.0.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
numexpr==2.8.6 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
numpy==1.24.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
openai==1.31.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
openai==1.43.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
packaging==23.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pkgutil-resolve-name==1.3.10 ; python_full_version >= "3.8.1" and python_version < "3.9" | ||
prompt-toolkit==3.0.36 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pydantic-core==2.18.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pydantic==2.7.3 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pydantic-core==2.23.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pydantic==2.9.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
python-dotenv==1.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pyyaml==6.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
pyyaml==6.0.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
questionary==2.0.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
regex==2024.5.15 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
referencing==0.35.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
regex==2024.7.24 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
requests==2.32.3 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
rpds-py==0.20.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
sniffio==1.3.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tiktoken==0.7.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tokenizers==0.19.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tqdm==4.66.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
typing-extensions==4.12.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
urllib3==2.2.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tokenizers==0.20.0 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tqdm==4.66.5 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
typing-extensions==4.12.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
tzdata==2024.1 ; python_version >= "3.9" and python_version < "4.0" | ||
urllib3==2.2.2 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
wcwidth==0.2.13 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
yarl==1.9.4 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
zipp==3.19.1 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
yarl==1.9.11 ; python_full_version >= "3.8.1" and python_version < "4.0" | ||
zipp==3.20.1 ; python_full_version >= "3.8.1" and python_version < "4.0" |
82 changes: 41 additions & 41 deletions
82
tests/agents/test_assistant_agent.py → tests/basic/agents/test_assistant_agent.py
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,41 +1,41 @@ | ||
import json | ||
from typing import Optional | ||
|
||
from promptulate import BaseMessage, MessageSet | ||
from promptulate.beta.agents.assistant_agent.agent import AssistantAgent | ||
from promptulate.beta.agents.assistant_agent.schema import ( | ||
AgentPlanResponse, | ||
Plan, | ||
) | ||
from promptulate.llms.base import BaseLLM | ||
|
||
|
||
class FakeLLM(BaseLLM): | ||
def _predict( | ||
self, messages: MessageSet, *args, **kwargs | ||
) -> Optional[type(BaseMessage)]: | ||
return None | ||
|
||
def __call__(self, instruction: str, *args, **kwargs): | ||
return "FakeLLM output" | ||
|
||
|
||
def fake_tool_1(): | ||
"""Fake tool 1""" | ||
return "Fake tool 1 output" | ||
|
||
|
||
def test_init_assistant_agent(): | ||
llm: BaseLLM = FakeLLM() | ||
agent = AssistantAgent(llm=llm, tools=[fake_tool_1]) | ||
|
||
assert len(agent.tool_manager.tools) == 1 | ||
|
||
|
||
def test_schema(): | ||
raw_data = """{\n \"goals\": [\"Find the hometown of the 2024 Australian Open winner\"],\n \"tasks\": [\n {\n \"task_id\": 1,\n \"description\": \"Identify the winner of the 2024 Australian Open.\"\n },\n {\n \"task_id\": 2,\n \"description\": \"Search for the biography or profile of the identified winner.\"\n },\n {\n \"task_id\": 3,\n \"description\": \"Locate the section of the biography or profile that specifies the player's hometown.\"\n },\n {\n \"task_id\": 4,\n \"description\": \"Record the hometown of the 2024 Australian Open winner.\"\n }\n ]\n}""" # noqa | ||
json_data = json.loads(raw_data) | ||
plan_resp = AgentPlanResponse(**json_data) | ||
|
||
plan = Plan.parse_obj({**plan_resp.dict(), "next_task_id": 1}) | ||
assert plan.next_task_id == 1 | ||
import json | ||
from typing import Optional | ||
|
||
from promptulate import BaseMessage, MessageSet | ||
from promptulate.beta.agents.assistant_agent.agent import AssistantAgent | ||
from promptulate.beta.agents.assistant_agent.schema import ( | ||
AgentPlanResponse, | ||
Plan, | ||
) | ||
from promptulate.llms.base import BaseLLM | ||
|
||
|
||
class FakeLLM(BaseLLM): | ||
def _predict( | ||
self, messages: MessageSet, *args, **kwargs | ||
) -> Optional[type(BaseMessage)]: | ||
return None | ||
|
||
def __call__(self, instruction: str, *args, **kwargs): | ||
return "FakeLLM output" | ||
|
||
|
||
def fake_tool_1(): | ||
"""Fake tool 1""" | ||
return "Fake tool 1 output" | ||
|
||
|
||
def test_init_assistant_agent(): | ||
llm: BaseLLM = FakeLLM() | ||
agent = AssistantAgent(llm=llm, tools=[fake_tool_1]) | ||
|
||
assert len(agent.tool_manager.tools) == 1 | ||
|
||
|
||
def test_schema(): | ||
raw_data = """{\n \"goals\": [\"Find the hometown of the 2024 Australian Open winner\"],\n \"tasks\": [\n {\n \"task_id\": 1,\n \"description\": \"Identify the winner of the 2024 Australian Open.\"\n },\n {\n \"task_id\": 2,\n \"description\": \"Search for the biography or profile of the identified winner.\"\n },\n {\n \"task_id\": 3,\n \"description\": \"Locate the section of the biography or profile that specifies the player's hometown.\"\n },\n {\n \"task_id\": 4,\n \"description\": \"Record the hometown of the 2024 Australian Open winner.\"\n }\n ]\n}""" # noqa | ||
json_data = json.loads(raw_data) | ||
plan_resp = AgentPlanResponse(**json_data) | ||
|
||
plan = Plan.parse_obj({**plan_resp.dict(), "next_task_id": 1}) | ||
assert plan.next_task_id == 1 |
Oops, something went wrong.