Spaces:
Runtime error
Runtime error
Download codeinterpreterapi/prompts/modifications_check.py from brzhang/codeinterpreter: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/spaces/brzhang/codeinterpreter/resolve/f4875a19a77bf164ed2199a2df3de9f04ea009d2/codeinterpreterapi/prompts/modifications_check.py
- Command line
-
hf download hf://spaces/brzhang/codeinterpreter@f4875a19a77bf164ed2199a2df3de9f04ea009d2/codeinterpreterapi/prompts/modifications_check.py
-
curl -L -o modifications_check.py https://huggingface.co/spaces/brzhang/codeinterpreter/resolve/f4875a19a77bf164ed2199a2df3de9f04ea009d2/codeinterpreterapi/prompts/modifications_check.py
1.38 kB
| from langchain.schema import SystemMessage | |
| from langchain.prompts.chat import ChatPromptTemplate, HumanMessagePromptTemplate | |
| determine_modifications_prompt = ChatPromptTemplate( | |
| input_variables=["code"], | |
| messages=[ | |
| SystemMessage( | |
| content="The user will input some code and you will need to determine if the code makes any changes to the file system. \n" | |
| "With changes it means creating new files or modifying exsisting ones.\n" | |
| "Answer with a function call `determine_modifications` and list them inside.\n" | |
| "If the code does not make any changes to the file system, still answer with the function call but return an empty list.\n", | |
| ), | |
| HumanMessagePromptTemplate.from_template("{code}"), | |
| ], | |
| ) | |
| determine_modifications_function = { | |
| "name": "determine_modifications", | |
| "description": "Based on code of the user determine if the code makes any changes to the file system. \n" | |
| "With changes it means creating new files or modifying exsisting ones.\n", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { | |
| "modifications": { | |
| "type": "array", | |
| "items": {"type": "string"}, | |
| "description": "The filenames that are modified by the code.", | |
| }, | |
| }, | |
| "required": ["modifications"], | |
| }, | |
| } | |