Last active
November 10, 2024 16:16
-
-
Save hideojoho/edd7ed027f0aaab4728ee68a2d488f80 to your computer and use it in GitHub Desktop.
Revisions
-
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ - Windows 11 - Python 3.12.3 - Git - OpenAI API Key ## Steps -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -49,8 +49,8 @@ # AutoGen Test ``` - Type `Ctrl+Enter` to run the Markdown cell - Add a Code cell below the previous cell - Select `+ Code` button below the previous cell to create a new Code cell and add the content ```python import os from dotenv import load_dotenv @@ -69,7 +69,7 @@ config_list_joe["temperature"] = 0.7 ``` - Type `Ctrl+Enter` to run the cell - Add another Code cell below the previous cell and run ```python def start_chat(cathy_setting, joe_setting, initial_message, max_turns=2): cathy = ConversableAgent( -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ - Windows 11 - Python 3.12.3 - OpenAI API Key ## Steps -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -38,11 +38,11 @@ (venv) > python -m pip install -U pip (venv) > python -m pip install -r requirements.txt ``` - Create a new (notebook) file called `autogen_test.ipynb`, then do the following - Type `Shift+Ctrl+P` to open a command palette - Type `notebook kernel` and select `Notebook: Select Notebook Kernel` - Select `Python Environment` and `venv (Python 3.xx.x) venv\Scripts\python.exe` - Add a Markdown cell to the notebook file - Select `+ Markdown` button from the top menu of the notebook to create a Markdown cell and add the content ```markdown # AutoGen Test -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ (venv) > python -m pip install -U pip (venv) > python -m pip install -r requirements.txt ``` - Create a new file called `autogen_test.ipynb`, then do the following - Type `Shift+Ctrl+P` to open a command palette - Type `notebook kernel` and select `Notebook: Select Notebook Kernel` - Select `Python Environment` and `venv (Python 3.xx.x) venv\Scripts\python.exe` -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ (venv) > python -m pip install -U pip (venv) > python -m pip install -r requirements.txt ``` - Create a new file called `autogen_test.ipynb` - Type `Shift+Ctrl+P` to open a command palette - Type `notebook kernel` and select `Notebook: Select Notebook Kernel` - Select `Python Environment` and `venv (Python 3.xx.x) venv\Scripts\python.exe` -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,12 @@ # How to get started with AutoGen 0.2 ## Environment - Windows 11 - Python 3.12.3 ## Steps - Create a new repository called `autogen_test` in GitHub - Type: `Private` - [x] Add a README file -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ - Type `clone` and select `Git: Clone` from the command menu - Paste the Clone URL - Select a folder to save the repository folder - In VSCode, create a new file called `.env`, add the following lines, and save ``` OPENAI_MODEL='gpt-4o-mini' OPENAI_API_KEY='[your open api key]' -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ - Start VSCode and type `Shift+Ctrl+P` to open a command palette - Type `clone` and select `Git: Clone` from the command menu - Paste the Clone URL - Select a folder to save the repository folder - Create a new file called `.env`, add the following lines, and save ``` OPENAI_MODEL='gpt-4o-mini' -
hideojoho revised this gist
Nov 10, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ - Clone the repository to VSCode - Copy Clone URL from the `<> Code` button at the top page of the repository on GitHub - Start VSCode and type `Shift+Ctrl+P` to open a command palette - Type `clone` and select `Git: Clone` from the command menu - Paste the Clone URL - Select a folder to clone the repository folder - Create a new file called `.env`, add the following lines, and save -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -128,4 +128,5 @@ - Change `initial_message` to change the topic of conversations. - What do you think about X? - Let's discuss the topic of X. - Increase the `max_turns` to 4 to change the length of conversations. - Commit your changes to the repository from VSCode. -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -123,9 +123,9 @@ ## What's next? - Change `cathy_setting` and `joe_setting` and re-run the cell to see how conversations change. - Change the age, location, job, hobby, etc. - Change `initial_message` to change the topic of conversations. - What do you think about X? - Let's discuss the topic of X. - Increase the `max_turns` to 4 to change the length of conversations. -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -124,5 +124,8 @@ ## What's next? - Change the setting of Cathy and Joe and re-run the cell to see how conversations change. - Change the age, location, job, hobby, etc. - Change the `initial_message` to change the topic of conversations - What do you think about X? - Let's discuss the topic of X. - Increase the `max_turns` to 4, and see how conversations develop. -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -123,6 +123,6 @@ ## What's next? - Change the setting of Cathy and Joe and re-run the cell to see how conversations change. - Change the `initial_message` to change the topic of conversations. - Increase the `max_turns` to 4, and see how conversations develop. -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ - Create a new file called `requirements.txt` and add the following lines ``` ipykernel pyautogen ``` - Open a new terminal at VSCode, create a virtual environment ```ps -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 65 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -54,30 +54,75 @@ "model": os.getenv('OPENAI_MODEL'), "api_key": os.getenv('OPENAI_API_KEY') } config_list_cathy = config_list.copy() config_list_cathy["temperature"] = 0.9 config_list_joe = config_list.copy() config_list_joe["temperature"] = 0.7 ``` - Type `Ctrl+Enter` to run the cell - Add another Code cell to notebook and run ```python def start_chat(cathy_setting, joe_setting, initial_message, max_turns=2): cathy = ConversableAgent( "cathy", system_message=cathy_setting, llm_config=config_list_cathy ) joe = ConversableAgent( "joe", system_message=joe_setting, llm_config=config_list_joe ) joe.initiate_chat(cathy, message=f"{initial_message}", max_turns=max_turns) ``` - Add another Code cell and run ```python cathy_setting = "Your name is Cathy and you are a part of a duo of comedians." joe_setting = "Your name is Joe and you are a part of a duo of comedians." initial_message = "Cathy, tell me a joke." max_turns = 2 start_chat(cathy_setting, joe_setting, initial_message, max_turns) ``` - You will see something like this (not exactly the same). ``` joe (to cathy): Cathy, tell me a joke. -------------------------------------------------------------------------------- >>>>>>>> USING AUTO REPLY... cathy (to joe): Sure, Joe! Why did the scarecrow win an award? Because he was outstanding in his field! 🌾😄 -------------------------------------------------------------------------------- >>>>>>>> USING AUTO REPLY... joe (to cathy): That's a classic, Cathy! Alright, here’s one for you: Why don’t scientists trust atoms? Because they make up everything! -------------------------------------------------------------------------------- >>>>>>>> USING AUTO REPLY... ... An impasta! 🍝😆 -------------------------------------------------------------------------------- Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings... ``` - Click `text editor` in the bottom message to view the entire conversation. ## What's next? - Change the setting of Cathy and Joe and re-run `start_chat` to see how conversations change. - Change the `initial_message` to change the topic of conversations. - Increase the `max_turns` to 4, and see how conversations develop. -
hideojoho revised this gist
Nov 9, 2024 . 1 changed file with 71 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,83 @@ # How to get started with AutoGen 0.2 - Create a new repository called `autogen_test` in GitHub - Type: `Private` - [x] Add a README file - Add .gitignore: `Python` - Choose a lisence: `None` - Clone the repository to VSCode - Copy Clone URL from the `<> Code` button at the top page of the repository on GitHub - Start VSCode and type `Shift+Ctrl+P` to open a command palette - Select `Git: Clone` from the command menu - Paste the Clone URL - Select a folder to clone the repository folder - Create a new file called `.env`, add the following lines, and save ``` OPENAI_MODEL='gpt-4o-mini' OPENAI_API_KEY='[your open api key]' ``` - Create a new file called `requirements.txt` and add the following lines ``` ipykernel autogen-agentchat~=0.2 ``` - Open a new terminal at VSCode, create a virtual environment ```ps > py.exe -m venv venv > .\venv\Scripts\activate ``` - Install Python modules in the virtual environment ```ps (venv) > python -m pip install -U pip (venv) > python -m pip install -r requirements.txt ``` - Create a new notebook called `autogen_test.ipynb` - Type `Shift+Ctrl+P` to open a command palette - Type `notebook kernel` and select `Notebook: Select Notebook Kernel` - Select `Python Environment` and `venv (Python 3.xx.x) venv\Scripts\python.exe` - Add a Markdown cell to the notebook - Select `+ Markdown` button from the top menu of the notebook to create a Markdown cell and add the content ```markdown # AutoGen Test ``` - Type `Ctrl+Enter` to run the Markdown cell - Add a Code cell to the notebook - Select `+ Code` button from the notebook to create a Code cell and add the content ```python import os from dotenv import load_dotenv from autogen import ConversableAgent load_dotenv() config_list = { "model": os.getenv('OPENAI_MODEL'), "api_key": os.getenv('OPENAI_API_KEY') } ``` - Type `Ctrl+Enter` to run the cell - Add another Code cell to notebook and run ```python config_list_cathy = config_list.copy() config_list_cathy["temperature"] = 0.9 config_list_joe = config_list.copy() config_list_joe["temperature"] = 0.7 cathy = ConversableAgent( "cathy", system_message="Your name is Cathy and you are a part of a duo of comedians.", llm_config=config_list_cathy, human_input_mode="NEVER", ) joe = ConversableAgent( "joe", system_message="Your name is Joe and you are a part of a duo of comedians.", llm_config=config_list_joe, human_input_mode="NEVER", ) ``` - Add another Code cell and run ```python result = joe.initiate_chat(cathy, message="Cathy, tell me a joke.", max_turns=2) ``` -
hideojoho created this gist
Nov 9, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # How to get started with AutoGen 0.2 - Create a new repository called `autogen_test` in GitHub - Type: Private - [x] Add a README file - Add .gitignore: Python - Choose a lisence: None - Clone the repository to VSCode - Copy Clone URL from the `<> Code` button at the top page of the repository on GitHub - Open VSCode and type `Shift+Ctrl+P` to open a command pallet - Select `Git: Clone` from the command menu - Paste the Clone URL - Select a folder to clone the repository folder - Add a new file called `requirements.txt` and the following lines ``` autogen-agentchat~=0.2 ```