Download scribe_python_client/mcp_app/responseAPi.py from eporath/TestSpace: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/eporath/TestSpace/resolve/main/scribe_python_client/mcp_app/responseAPi.py
- Command line
-
hf download hf://spaces/eporath/TestSpace/scribe_python_client/mcp_app/responseAPi.py
-
curl -L -o responseAPi.py https://huggingface.co/spaces/eporath/TestSpace/resolve/main/scribe_python_client/mcp_app/responseAPi.py
1.3 kB
| from openai import OpenAI | |
| from dotenv import load_dotenv | |
| from pathlib import Path | |
| import json | |
| readPath = Path(__file__).parent / "toolsDescriptions/tool_docs.json" | |
| load_dotenv() | |
| def main(): | |
| client = OpenAI() | |
| with open(readPath, "r") as f: | |
| tool_description = json.load(f) | |
| instructions = "Tool usage guidance:\n" + json.dumps(tool_description, indent=2) | |
| response = client.responses.create( | |
| model= "gpt-4o", | |
| tools= [{ | |
| "type": "mcp", | |
| "server_label": "ScriScribeMCPHuggingFacebeMCP", | |
| "server_url": "https://eporath-scribe-mcp.hf.space/mcp", | |
| "require_approval": "never", | |
| }], | |
| input = "Query the vulnerabilities table for the top 5 risky CVEs - KEV vulnerabilities and vulnerabilities with highest EPSS scores." | |
| #+ "Take each risky CVES from the first query and then Query the vulnerabilities table of each of them to get a list of affected products." | |
| #+ "Create a report summarizing the findings." | |
| #+ "Query the lineage check if these products have assets of type pod; in that case these products are in production and are more risky." | |
| #instructions = instructions | |
| ) | |
| print(response.output_text) | |
| if __name__ == "__main__": | |
| main() |