Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issues in notebooks interfering with testing automation #377

Merged
merged 7 commits into from
Sep 5, 2024
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
pip install -U jupyter
- name: Create .env file
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env
echo "AGENTOPS_API_KEY=${{ secrets.AGENTOPS_API_KEY }}" >> .env
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env
echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> .env
echo "CO_API_KEY=${{ secrets.CO_API_KEY }}" >> .env
echo "GROQ_API_KEY=${{ secrets.GROQ_API_KEY }}" >> .env
echo "MULTION_API_KEY=${{ secrets.MULTION_API_KEY }}" >> .env
Expand Down
4 changes: 2 additions & 2 deletions examples/anthropic/anthropic_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
" messages=[\n",
" {\n",
" \"role\": \"user\",\n",
" \"content\": \"What is 2+2?\",\n",
" \"content\": \"How much wood could a wood chuck chuck if a wood chuck could chuck wood?\",\n",
" }\n",
" ],\n",
" stream=True,\n",
Expand Down Expand Up @@ -227,7 +227,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
38 changes: 10 additions & 28 deletions examples/autogen/AgentChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"source": [
"# Adding AgentOps to an existing Autogen service\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen_integration.png?raw=true\"/>\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen-integration.png?raw=true\"/>\n",
"\n",
"To get started, you'll need to install the AgentOps package and [set an API key](app.agentops.ai).\n",
"\n",
Expand Down Expand Up @@ -52,7 +52,8 @@
"from autogen import ConversableAgent, UserProxyAgent\n",
"import agentops\n",
"import os\n",
"from dotenv import load_dotenv"
"from dotenv import load_dotenv\n",
"from IPython.core.error import StdinNotImplementedError"
]
},
{
Expand Down Expand Up @@ -105,33 +106,10 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "2962d990-f7ef-43d8-ba09-d29bd8356d9f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[31m\n",
">>>>>>>> NO HUMAN INPUT RECEIVED.\u001b[0m\n",
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[33muser\u001b[0m (to agent):\n",
"\n",
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[31m\n",
">>>>>>>> USING AUTO REPLY...\u001b[0m\n",
"\u001b[33magent\u001b[0m (to user):\n",
"\n",
"It seems there might still be an issue. If you need assistance or have questions later on, don't hesitate to reach out. I'm here to help whenever you're ready!\n",
"\n",
"--------------------------------------------------------------------------------\n"
]
}
],
"outputs": [],
"source": [
"# Define model, openai api key, tags, etc in the agent configuration\n",
"config_list = [\n",
Expand All @@ -145,7 +123,11 @@
"user_proxy = UserProxyAgent(\"user\", code_execution_config=False)\n",
"\n",
"# Let the assistant start the conversation. It will end when the user types \"exit\".\n",
"assistant.initiate_chat(user_proxy, message=\"How can I help you today?\")\n",
"try:\n",
" assistant.initiate_chat(user_proxy, message=\"How can I help you today?\")\n",
"except StdinNotImplementedError:\n",
" # This is only necessary for AgentOps testing automation which is headless and will not have user input\n",
" print(\"Stdin not implemented. Skipping initiate_chat\")\n",
"\n",
"# Close your AgentOps session to indicate that it completed.\n",
"agentops.end_session(\"Success\")\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/autogen/MathAgent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"source": [
"# Adding AgentOps to an existing Autogen service\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen_integration.png?raw=true\"/>\n",
"<img src=\"https://raw.githubusercontent.com/AgentOps-AI/agentops/main/docs/images/external/autogen/autogen-integration.png?raw=true\"/>\n",
"\n",
"To get started, you'll need to install the AgentOps package and [set an API key](app.agentops.ai).\n",
"\n",
Expand Down
Loading
Loading