Download mcp/protocols.py from mgbam/MCP_Res: direct link, hf CLI and curl.
- Browser
- Download file 773 Bytes
-
https://huggingface.co/spaces/mgbam/MCP_Res/resolve/49fee0b83cc6421d58b3568b62846bb4cc8cd6c0/mcp/protocols.py
- Command line
-
hf download hf://spaces/mgbam/MCP_Res@49fee0b83cc6421d58b3568b62846bb4cc8cd6c0/mcp/protocols.py
-
curl -L -o protocols.py https://huggingface.co/spaces/mgbam/MCP_Res/resolve/49fee0b83cc6421d58b3568b62846bb4cc8cd6c0/mcp/protocols.py
773 Bytes
| # ββ mcp/protocols.py βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| import asyncio | |
| from mcp.openai_utils import ai_qa | |
| from mcp.gemini import gemini_qa | |
| async def draft_protocol(question: str, context: str, llm: str = "openai") -> str: | |
| """ | |
| Draft a detailed experimental protocol for a given hypothesis/question. | |
| """ | |
| if llm.lower() == "gemini": | |
| qa_fn = gemini_qa | |
| else: | |
| qa_fn = ai_qa | |
| prompt = ( | |
| "You are a senior researcher. Draft a step-by-step experimental protocol to test: " | |
| f"{question}\nContext:\n{context}\nInclude materials, methods, controls, expected outcomes." | |
| ) | |
| return await qa_fn(prompt) |