Skip to content

Commit

Permalink
fix of the notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Kulaga committed Nov 22, 2024
1 parent 32286ce commit f5e5e7c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion just_agents_examples/basic/agent_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if __name__ == "__main__":

config_path = basic_examples_dir / "yaml_initialization_example_new.yaml"
config_path = basic_examples_dir / "agent_profiles.yaml"

created_agent = BaseAgent(
llm_options=just_agents.llm_options.LLAMA3_2_VISION,
Expand Down
3 changes: 2 additions & 1 deletion just_agents_examples/notebooks/01_just_agents_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
}
],
"source": [
"!pip install just-agents"
"!pip install just-agents\n",
"!pip install just-agents-examples"
]
},
{
Expand Down
30 changes: 13 additions & 17 deletions just_agents_examples/notebooks/02_sqlite_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@
}
],
"source": [
"!pip install just-agents"
"!pip install just-agents\n",
"!pip install just-agents-examples"
]
},
{
Expand Down Expand Up @@ -473,21 +474,18 @@
}
],
"source": [
"import asyncio\n",
"import json\n",
"import pprint\n",
"import just_agents\n",
"from just_agents import llm_options\n",
"from just_agents.base_agent import BaseAgent\n",
"\n",
"llm_options = just_agents.llm_options.OPENAI_GPT4oMINI\n",
"\n",
"\n",
"\n",
"prompt = \"What processes are improved in GHR knockout mice?\"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
" llm_options=just_agents.llm_options.OPENAI_GPT4oMINI,\n",
" llm_options=llm_options.OPENAI_GPT4oMINI,\n",
" tools=[db_query]\n",
")\n",
"\n",
Expand Down Expand Up @@ -553,21 +551,21 @@
],
"source": [
"from just_agents.base_agent import BaseAgent\n",
"llm_options = just_agents.llm_options.OPENAI_GPT4o\n",
"from just_agents import llm_options\n",
"\n",
"\n",
"prompt = \"Interventions on which genes extended mice lifespan most of all?\"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
" llm_options=just_agents.llm_options.OPENAI_GPT4o,\n",
"agent: BaseAgent = BaseAgent(\n",
" llm_options=llm_options.OPENAI_GPT4o\n",
" tools=[db_query]\n",
")\n",
"\n",
"\n",
"result = session.query(prompt)\n",
"result = agent.query(prompt)\n",
"\n",
"session.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"result = session.query(prompt)\n",
"agent.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"result = agent.query(prompt)\n",
"\n",
"print(\"RESULT+++++++++++++++++++++++++++++++++++++++++++++++\")\n",
"print(result)"
Expand Down Expand Up @@ -686,13 +684,12 @@
],
"source": [
"from just_agents.base_agent import BaseAgent\n",
"llm_options = just_agents.llm_options.OPENAI_GPT4o\n",
"\n",
"from just_agents import llm_options\n",
"\n",
"prompt = \"Interventions on which genes extended mice lifespan most of all? Search all the relevant tables in the open-genes sqlite and only for mouse\"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
" llm_options=just_agents.llm_options.OPENAI_GPT4o,\n",
" llm_options=llm_options.OPENAI_GPT4o,\n",
" system_prompt='open_genes.txt',\n",
" tools=[db_query]\n",
")\n",
Expand Down Expand Up @@ -926,14 +923,13 @@
],
"source": [
"from just_agents.base_agent import BaseAgent\n",
"llm_options = just_agents.llm_options.OPENAI_GPT4oMINI\n",
"\n",
"from just_agents import llm_options\n",
"\n",
"prompt = \"Interventions on which genes extended mice lifespan most of all? Search all the relevant tables in the open-genes sqlite and only for mouse\"\n",
"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
" llm_options=just_agents.llm_options.OPENAI_GPT4oMINI,\n",
" llm_options=llm_options.OPENAI_GPT4oMINI,\n",
" system_prompt='open_genes.txt',\n",
" tools=[db_query]\n",
")\n",
Expand Down
16 changes: 8 additions & 8 deletions just_agents_examples/notebooks/03_coding_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,13 @@
"\n",
"prompt = \"Compute 2 * 10 + (342 +3) / 23.0\"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
"agent: BaseAgent = BaseAgent(\n",
" llm_options=llm_options.LLAMA3_2,\n",
" tools=[run_python_code]\n",
")\n",
"session.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"agent.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"\n",
"response = session.query(prompt)\n",
"response = agent.query(prompt)\n",
"f\"\"\"MODEL RESPONSE = \"{response}\" \"\"\""
]
},
Expand Down Expand Up @@ -411,7 +411,7 @@
}
],
"source": [
"session.query(\"translate ATGCATAGGTAG with biopython\")"
"agent.query(\"translate ATGCATAGGTAG with biopython\")"
]
},
{
Expand Down Expand Up @@ -523,13 +523,13 @@
"import pprint\n",
"\n",
"\n",
"session: BaseAgent = BaseAgent(\n",
"agent: BaseAgent = BaseAgent(\n",
" llm_options=llm_options.OPENAI_GPT4oMINI,\n",
" tools=[run_python_code, execute_bash]\n",
")\n",
"session.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"agent.memory.add_on_message(lambda m: pprint.pprint(m))\n",
"\n",
"result = session.query(\"Install biopython with pip\")\n",
"result = agent.query(\"Install biopython with pip\")\n",
"result"
]
},
Expand Down Expand Up @@ -730,7 +730,7 @@
}
],
"source": [
"session.query(\"translate ATGCATAGGTAG with biopython\")"
"agent.query(\"translate ATGCATAGGTAG with biopython\")"
]
},
{
Expand Down

0 comments on commit f5e5e7c

Please sign in to comment.