Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions autogen/autogen-gemini/instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Google Gemini API=>https://cloud.google.com/vertex-ai/docs/generative-ai/multimo
2. Run your code local machine:

```
python3.11 -m venv pyautogen
source pyautogen/bin/activate
python3.11 -m venv ag2
source ag2/bin/activate
# deactivate
pip install pyautogen google-generativeai
pip install ag2 google-generativeai
pip install -q google-generativeai

python autogen/autogen-gemini/autogen_gemini.py
Expand Down
20 changes: 10 additions & 10 deletions autogen/autogen_assistant/autogen_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#base_url = "http://localhost:1234/v1" # You can specify API base URLs if needed. eg: localhost:8000
#http://10.9.150.174:1234/v1/models
base_url = "http://192.168.40.229:1234/v1" #Sidan's Server Mistral-7B-Instruct-v0.1-GGUF/mistral-7b-instruct-v0.1.Q8_0.gguf
#base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 pyautogen==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
#base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 ag2==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
api_type = "openai" # Type of API, e.g., "openai" or "aoai".
api_version = None # Specify API version if needed.
#api_model= "palm/chat-biso"
Expand Down Expand Up @@ -111,15 +111,15 @@ def run_openai_completion():



#=============autogen run_autogen_with_twoagent_pyautogen_latest_version=============
#refer:https://pypi.org/project/pyautogen/0.1.14/
#=============autogen run_autogen_with_twoagent_ag2_latest_version=============
#refer:https://pypi.org/project/ag2/0.1.14/
'''
This code required the dependency follow these(also pay attention with api_base and api_key and api_model) :
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
'''
def run_autogen_with_twoagent_pyautogen_latest_version():
def run_autogen_with_twoagent_ag2_latest_version():
try:
#Base on openai==0.28 pyautogen==0.1.14 ,If you want to use your own LLM,you must be override your openai.api_base and openai.api_key for autogen, otherwise won't be work.
#Base on openai==0.28 ag2==0.1.14 ,If you want to use your own LLM,you must be override your openai.api_base and openai.api_key for autogen, otherwise won't be work.
openai.api_key = api_key # supply your API key however you choose
openai.api_base= base_url # supply your api base URL If you have your own LLM
assistant = AssistantAgent("assistant", llm_config={"api_key":api_key,"base_url": base_url,"api_model":api_model})
Expand All @@ -128,7 +128,7 @@ def run_autogen_with_twoagent_pyautogen_latest_version():
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
# This triggers automated chat to solve the task
except Exception as e:
print(f"""run_autogen_with_twoagent_pyautogen_latest_version failed with Exception{e}. \n""")
print(f"""run_autogen_with_twoagent_ag2_latest_version failed with Exception{e}. \n""")
# ##====================================================


Expand All @@ -155,7 +155,7 @@ def run_autogen_with_twoagent_pyautogen_latest_version():
# and OAI_CONFIG_LIST_sample
'''
This code required the dependency follow these(also pay attention with config_list.api_base and config_list.api_key and config_list.api_model) :
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
'''
def run_autogen_with_twoagent():
config_list = [
Expand Down Expand Up @@ -185,7 +185,7 @@ def run_autogen_with_twoagent():
#========================run_autogen_with_Assistant_and_userProxy============================
'''
This code required the dependency follow these(also pay attention with config_list.api_base and config_list.api_key and config_list.api_model) :
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
'''
def run_autogen_with_Assistant_and_userProxy():
try:
Expand Down Expand Up @@ -227,4 +227,4 @@ def run_autogen_with_Assistant_and_userProxy():
#run_autogen_with_Assistant_and_userProxy()
#run_autogen_with_twoagent()
#run_openai_completion()
run_autogen_with_twoagent_pyautogen_latest_version()
run_autogen_with_twoagent_ag2_latest_version()
10 changes: 5 additions & 5 deletions autogen/autogen_assistant/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

2. Run your code local machine:
```
python3.12 -m venv pyautogen
source pyautogen/bin/activate
python3.12 -m venv ag2
source ag2/bin/activate
# deactivate
# old version with between Aug 2023 and Oct 2023
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
# latest
pip install openai==1.6.1 pyautogen==0.2.3
pip show pyautogen
pip install openai==1.6.1 ag2==0.2.3
pip show ag2

python autogen/autogen_assistant/autogen_assistant.py

Expand Down
8 changes: 4 additions & 4 deletions autogen/autogenra/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Or use LM Studio build your local LLM => https://lmstudio.ai/

2. Run your code local machine:
```
python3.12 -m venv pyautogen
source pyautogen/bin/activate
python3.12 -m venv ag2
source ag2/bin/activate
# deactivate
# old version with between Aug 2023 and Oct 2023
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
# latest
pip install openai==1.6.1 pyautogen==0.2.3
pip install openai==1.6.1 ag2==0.2.3

pip install -r requirements.txt

Expand Down
4 changes: 2 additions & 2 deletions autogen/multiagents_groupchat/log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BadRequestError: Error code: 400 - {'error': "'messages' array must only contain


--------------------------------------------------------------------------------
(pyautogen) root@1cfeec487615:/home/tmp/mingwork/llm_sample# python autogen/multiagents_groupchat/multiagents_groupchat.py
(ag2) root@1cfeec487615:/home/tmp/mingwork/llm_sample# python autogen/multiagents_groupchat/multiagents_groupchat.py
====================
openai.Model.list=> {
"data": [
Expand Down Expand Up @@ -180,4 +180,4 @@ user_proxy (to chat_manager):
--------------------------------------------------------------------------------
==========completed run_agentchat_multiagents_groupchat=============

(pyautogen) root@1cfeec487615:/home/tmp/mingwork/llm_sample#
(ag2) root@1cfeec487615:/home/tmp/mingwork/llm_sample#
6 changes: 3 additions & 3 deletions autogen/multiagents_groupchat/multiagents_groupchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import openai


#Initial your Custom llm_config configurations,LM Studio Server support SKD is openai==0.28 pyautogen==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
# base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 pyautogen==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
#Initial your Custom llm_config configurations,LM Studio Server support SKD is openai==0.28 ag2==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
# base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 ag2==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
# api_model="TinyLlama--TinyLlama-1.1B-Chat-v1.0"
base_url = "http://192.168.0.232:1234/v1" #Sidan's Server Mistral-7B-Instruct-v0.2-GGUF/mistral-7b-instruct-v0.2.Q6_K.gguf
api_model="Mistral-7B-Instruct-v0.2-GGUF/mistral-7b-instruct-v0.2.Q6_K.gguf"
Expand Down Expand Up @@ -37,7 +37,7 @@

def run_agentchat_multiagents_groupchat():
# try:
#Base on openai==0.28 pyautogen==0.1.14 ,If you want to use your own LLM,you must be override your openai.api_base and openai.api_key for autogen, otherwise won't be work.
#Base on openai==0.28 ag2==0.1.14 ,If you want to use your own LLM,you must be override your openai.api_base and openai.api_key for autogen, otherwise won't be work.
openai.api_key = api_key # supply your API key however you choose
openai.api_base= base_url # supply your api base URL If you have your own LLM
openai.model = api_model # supply your api base URL If you have your own model (PS:openLLM required change the model,LM Studio doesn't care about model)
Expand Down
10 changes: 5 additions & 5 deletions autogen/multiagents_groupchat/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Or use LM Studio build your local LLM => https://lmstudio.ai/

2. Run your code local machine:
```
python3.12 -m venv pyautogen
source pyautogen/bin/activate
python3.12 -m venv ag2
source ag2/bin/activate
# deactivate
# old version with between Aug 2023 and Oct 2023
pip install openai==0.28 pyautogen==0.1.14
pip install openai==0.28 ag2==0.1.14
# latest
pip install openai==1.6.1 pyautogen==0.2.3
pip show pyautogen
pip install openai==1.6.1 ag2==0.2.3
pip show ag2

python autogen/multiagents_groupchat/multiagents_groupchat.py

Expand Down
2 changes: 1 addition & 1 deletion crewagent/crewagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#os.environ["OPENAI_API_KEY"] = "YOUR KEY"
g_base_url = "http://192.168.137.176:1234/v1" #Sidan's Server Mistral-7B-Instruct-v0.1-GGUF/mistral-7b-instruct-v0.1.Q8_0.gguf
g_api_key = "sk-llllllllllllllllllllll" # even your local don't use the authorization, but you need to fill something, otherwise will be get exception.
#g_base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 pyautogen==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
#g_base_url = "http://airedale-native-chicken.ngrok-free.app/v1" # Seems like OpenLLM server only support SKD is openai==0.28 ag2==0.1.14 . refer: https://colab.research.google.com/drive/1GKlfU7Fjq30oQPirHvCcQy_e_B8vNEDs?usp=sharing
#g_api_model="NousResearch--Nous-Hermes-llama-2-7b"
g_api_model="TinyLlama--TinyLlama-1.1B-Chat-v1.0"
os.environ["OPENAI_API_KEY"] = g_api_key
Expand Down