From cf11b233c6ecc4ee22bac494a784fc43474d5818 Mon Sep 17 00:00:00 2001 From: Huu Le <39040748+leehuwuj@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:34:36 +0700 Subject: [PATCH] feat: support using azure code interpreter in create-llama (#158) --------- Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de> Co-authored-by: Wassim Chegham <github@wassim.dev> Co-authored-by: Thuc Pham <51660321+thucpn@users.noreply.github.com> --- .changeset/poor-squids-hide.md | 5 ++++ helpers/tools.ts | 29 +++++++++++++++++++ .../types/streaming/express/package.json | 2 +- templates/types/streaming/nextjs/package.json | 2 +- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .changeset/poor-squids-hide.md diff --git a/.changeset/poor-squids-hide.md b/.changeset/poor-squids-hide.md new file mode 100644 index 00000000..a8cc8b45 --- /dev/null +++ b/.changeset/poor-squids-hide.md @@ -0,0 +1,5 @@ +--- +"create-llama": patch +--- + +Add Azure code interpreter for Python and TS diff --git a/helpers/tools.ts b/helpers/tools.ts index f1fd9f65..c92499f2 100644 --- a/helpers/tools.ts +++ b/helpers/tools.ts @@ -188,6 +188,35 @@ For better results, you can specify the region parameter to get results from a s }, ], }, + { + display: "Azure Code Interpreter", + name: "azure_code_interpreter.AzureCodeInterpreterToolSpec", + supportedFrameworks: ["fastapi", "nextjs", "express"], + type: ToolType.LLAMAHUB, + dependencies: [ + { + name: "llama-index-tools-azure-code-interpreter", + version: "0.2.0", + }, + ], + envVars: [ + { + name: "AZURE_POOL_MANAGEMENT_ENDPOINT", + description: + "Please follow this guideline to create and get the pool management endpoint: https://learn.microsoft.com/azure/container-apps/sessions?tabs=azure-cli", + }, + { + name: TOOL_SYSTEM_PROMPT_ENV_VAR, + description: "System prompt for Azure code interpreter tool.", + value: `-You are a Python interpreter that can run any python code in a secure environment. +- The python code runs in a Jupyter notebook. Every time you call the 'interpreter' tool, the python code is executed in a separate cell. +- You are given tasks to complete and you run python code to solve them. +- It's okay to make multiple calls to interpreter tool. If you get an error or the result is not what you expected, you can call the tool again. Don't give up too soon! +- Plot visualizations using matplotlib or any other visualization library directly in the notebook. +- You can install any pip package (if it exists) by running a cell with pip install.`, + }, + ], + }, ]; export const getTool = (toolName: string): Tool | undefined => { diff --git a/templates/types/streaming/express/package.json b/templates/types/streaming/express/package.json index f225502b..af64a5f2 100644 --- a/templates/types/streaming/express/package.json +++ b/templates/types/streaming/express/package.json @@ -20,7 +20,7 @@ "dotenv": "^16.3.1", "duck-duck-scrape": "^2.2.5", "express": "^4.18.2", - "llamaindex": "0.5.7", + "llamaindex": "0.5.8", "pdf2json": "3.0.5", "ajv": "^8.12.0", "@e2b/code-interpreter": "^0.0.5", diff --git a/templates/types/streaming/nextjs/package.json b/templates/types/streaming/nextjs/package.json index 59e8dafa..0bcfe4bb 100644 --- a/templates/types/streaming/nextjs/package.json +++ b/templates/types/streaming/nextjs/package.json @@ -24,7 +24,7 @@ "duck-duck-scrape": "^2.2.5", "formdata-node": "^6.0.3", "got": "^14.4.1", - "llamaindex": "0.5.7", + "llamaindex": "0.5.8", "lucide-react": "^0.294.0", "next": "^14.2.4", "react": "^18.2.0", -- GitLab