Skip to content

Commit

Permalink
Merge branch 'lmm' of https://github.com/BeibinLi/autogen into lmm
Browse files Browse the repository at this point in the history
  • Loading branch information
BeibinLi committed Nov 5, 2023
2 parents 2e1d4fb + f9d1068 commit 1ed2b84
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
- 'test/**'
- 'notebook/agentchat_auto_feedback_from_code_execution.ipynb'
- 'notebook/agentchat_function_call.ipynb'
<<<<<<< HEAD
- 'notebook/agentchat_MathChat.ipynb'
=======
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
- '.github/workflows/openai.yml'

jobs:
Expand All @@ -36,9 +39,9 @@ jobs:
run: |
docker --version
python -m pip install --upgrade pip wheel
pip install -e.[blendsearch]
pip install -e.
python -c "import autogen"
pip install coverage pytest-asyncio datasets
pip install coverage pytest-asyncio
- name: Install packages for test when needed
if: matrix.python-version == '3.9'
run: |
Expand Down Expand Up @@ -68,7 +71,10 @@ jobs:
run: |
pip install nbconvert nbformat ipykernel
coverage run -a -m pytest test/agentchat/test_function_call_groupchat.py
<<<<<<< HEAD
coverage run -a -m pytest test/agentchat/test_teachable_agent.py
=======
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
coverage run -a -m pytest test/test_notebook.py
coverage xml
cat "$(pwd)/test/executed_openai_notebook_output.txt"
Expand Down
4 changes: 4 additions & 0 deletions autogen/agentchat/contrib/llava_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
from regex import R

from autogen.agentchat.agent import Agent
<<<<<<< HEAD
from autogen.agentchat.multimodal_conversable_agent import \
MultimodalConversableAgent
=======
from autogen.agentchat.multimodal_conversable_agent import MultimodalConversableAgent
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
from autogen.img_utils import get_image_data, lmm_formater

try:
Expand Down
17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,30 @@
install_requires=install_requires,
extras_require={
"test": [
<<<<<<< HEAD
"coverage>=5.3",
=======
# "chromadb",
# "lancedb",
"coverage>=5.3",
# "datasets",
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
"ipykernel",
"nbconvert",
"nbformat",
"pre-commit",
<<<<<<< HEAD
"pytest-asyncio",
"pytest>=6.1.1",
=======
# "pydantic==1.10.9",
"pytest-asyncio",
"pytest>=6.1.1",
# "sympy",
# "tiktoken",
# "wolframalpha",
# "qdrant_client[fastembed]",
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
],
"blendsearch": ["flaml[blendsearch]"],
"mathchat": ["sympy", "pydantic==1.10.9", "wolframalpha"],
Expand Down
15 changes: 14 additions & 1 deletion test/agentchat/test_function_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
from openai import OpenAI
except ImportError:
OpenAI = None
<<<<<<< HEAD:test/agentchat/test_function_call.py
=======
import pytest
import asyncio
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9:test/test_function_call.py
import json

import pytest
from test_assistant_agent import KEY_LOC

import autogen
from autogen.math_utils import eval_math_responses
<<<<<<< HEAD:test/agentchat/test_function_call.py
=======
from test_assistant_agent import KEY_LOC
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9:test/test_function_call.py


@pytest.mark.skipif(OpenAI is None, reason="openai>=1 not installed")
Expand Down Expand Up @@ -193,4 +202,8 @@ def get_number():
# test_json_extraction()
# test_execute_function()
asyncio.run(test_a_execute_function())
test_eval_math_responses()
<<<<<<< HEAD:test/agentchat/test_function_call.py
test_eval_math_responses()
=======
test_eval_math_responses()
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9:test/test_function_call.py
2 changes: 1 addition & 1 deletion test/test_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_agentchat_function_call(save=False):
skip or not sys.version.startswith("3.10"),
reason="do not run if openai is not installed or py!=3.10",
)
def test_agentchat_MathChat(save=False):
def _test_agentchat_MathChat(save=False):
run_notebook("agentchat_MathChat.ipynb", save=save)


Expand Down
17 changes: 17 additions & 0 deletions test/test_retrieve_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
try:
import chromadb
<<<<<<< HEAD
import tiktoken

from autogen.retrieve_utils import (TEXT_FORMATS,
Expand All @@ -13,12 +14,28 @@
num_tokens_from_text, query_vector_db,
split_files_to_chunks,
split_text_to_chunks)
=======
from autogen.retrieve_utils import (
split_text_to_chunks,
extract_text_from_pdf,
split_files_to_chunks,
get_files_from_dir,
is_url,
create_vector_db_from_dir,
query_vector_db,
)
from autogen.token_count_utils import count_token
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9
except ImportError:
skip = True
else:
skip = False
import os
<<<<<<< HEAD
import sys
=======
import pytest
>>>>>>> f9d1068c7740f90b4c7d2b2e0df08351a2ccb5a9

import chromadb
import pytest
Expand Down

0 comments on commit 1ed2b84

Please sign in to comment.