Skip to content

Commit

Permalink
colab links fix (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
init27 authored Nov 16, 2024
2 parents b9fc106 + b579bd0 commit 4250439
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "7a4b75bb-d60a-41e3-abca-1ca0f0bf1201",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/dlai/AI_Agentic_Design_Patterns_with_AutoGen_L4_Tool_Use_and_Conversational_Chess.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/DeepLearningai_Course_Notebooks/AI_Agentic_Design_Patterns_with_AutoGen_L4_Tool_Use_and_Conversational_Chess.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -63,7 +63,7 @@
"outputs": [],
"source": [
"def get_legal_moves(\n",
" \n",
"\n",
") -> Annotated[str, \"A list of legal moves in UCI format\"]:\n",
" return \"Possible moves are: \" + \",\".join(\n",
" [str(move) for move in board.legal_moves]\n",
Expand All @@ -86,7 +86,7 @@
" board.push_uci(str(move))\n",
" global made_move\n",
" made_move = True\n",
" \n",
"\n",
" svg_str = chess.svg.board(\n",
" board,\n",
" arrows=[(move.from_square, move.to_square)],\n",
Expand All @@ -96,7 +96,7 @@
" display(\n",
" SVG(data=svg_str)\n",
" )\n",
" \n",
"\n",
" # Get the piece name.\n",
" piece = board.piece_at(move.to_square)\n",
" piece_symbol = piece.unicode_symbol()\n",
Expand Down Expand Up @@ -223,7 +223,7 @@
" name=\"get_legal_moves\",\n",
" description=\"Call this tool to get all legal moves in UCI format.\",\n",
" )\n",
" \n",
"\n",
" register_function(\n",
" make_move,\n",
" caller=caller,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "de56ee05-3b71-43c9-8cbf-6ad9b3233f38",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/dlai/AI_Agents_in_LangGraph_L1_Build_an_Agent_from_Scratch.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/DeepLearningai_Course_Notebooks/AI_Agents_in_LangGraph_L1_Build_an_Agent_from_Scratch.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -35,7 +35,7 @@
"metadata": {},
"outputs": [],
"source": [
"import os \n",
"import os\n",
"from groq import Groq\n",
"\n",
"os.environ['GROQ_API_KEY'] = 'your_groq_api_key' # get a free key at https://console.groq.com/keys"
Expand All @@ -48,7 +48,7 @@
"metadata": {},
"outputs": [],
"source": [
"# a quick sanity test of calling Llama 3 70b on Groq \n",
"# a quick sanity test of calling Llama 3 70b on Groq\n",
"# see https://console.groq.com/docs/text-chat for more info\n",
"client = Groq()\n",
"chat_completion = client.chat.completions.create(\n",
Expand All @@ -75,7 +75,7 @@
"source": [
"client = Groq()\n",
"model = \"llama3-8b-8192\" # this model works with the prompt below only for the first simpler example; you'll see how to modify the prompt to make it work for a more complicated question\n",
"#model = \"llama3-70b-8192\" # this model works with the prompt below for both example questions \n",
"#model = \"llama3-70b-8192\" # this model works with the prompt below for both example questions\n",
"\n",
"class Agent:\n",
" def __init__(self, system=\"\"):\n",
Expand All @@ -95,8 +95,7 @@
" model=model,\n",
" temperature=0,\n",
" messages=self.messages)\n",
" return completion.choices[0].message.content\n",
" "
" return completion.choices[0].message.content\n"
]
},
{
Expand Down Expand Up @@ -151,7 +150,7 @@
" return eval(what)\n",
"\n",
"def average_dog_weight(name):\n",
" if name in \"Scottish Terrier\": \n",
" if name in \"Scottish Terrier\":\n",
" return(\"Scottish Terriers average 20 lbs\")\n",
" elif name in \"Border Collie\":\n",
" return(\"a Border Collies average weight is 37 lbs\")\n",
Expand Down Expand Up @@ -423,7 +422,7 @@
"\n",
" # key to make the agent process fully automated:\n",
" # programtically call the external func with arguments, with the info returned by LLM\n",
" observation = known_actions[action](action_input) \n",
" observation = known_actions[action](action_input)\n",
"\n",
" print(\"Observation:\", observation)\n",
" next_prompt = \"Observation: {}\".format(observation)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"outputs": [],
"source": [
"import os \n",
"import os\n",
"os.environ['GROQ_API_KEY'] = 'your_groq_api_key' # get a free key at https://console.groq.com/keys"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "2ba1b4ef-3b96-4e7e-b5d0-155b839db73c",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/dlai/Functions_Tools_and_Agents_with_LangChain_L1_Function_Calling.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/quickstart/agents/DeepLearningai_Course_Notebooks/Functions_Tools_and_Agents_with_LangChain_L1_Function_Calling.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -62,7 +62,7 @@
"outputs": [],
"source": [
"# https://console.groq.com/docs/tool-use#models\n",
"# Groq API endpoints support tool use for programmatic execution of specified operations through requests with explicitly defined \n",
"# Groq API endpoints support tool use for programmatic execution of specified operations through requests with explicitly defined\n",
"# operations. With tool use, Groq API model endpoints deliver structured JSON output that can be used to directly invoke functions.\n",
"\n",
"from groq import Groq\n",
Expand Down Expand Up @@ -145,8 +145,8 @@
" model=\"llama3-70b-8192\",\n",
" messages=messages,\n",
" functions=functions,\n",
" #tools=tools, # you can also replace functions with tools, as specified in https://console.groq.com/docs/tool-use \n",
" max_tokens=4096, \n",
" #tools=tools, # you can also replace functions with tools, as specified in https://console.groq.com/docs/tool-use\n",
" max_tokens=4096,\n",
" temperature=0\n",
")"
]
Expand Down

0 comments on commit 4250439

Please sign in to comment.