Spaces:
Build error
Build error
Use OpenAI service for chat and other fixes (#1)
Browse files- Duplicate code (8cd6fde1b446eedcc7fb93e454909012aa44a3e1)
- Update chat name (0c92aa0549c831e54b6ff5dda16f6a13b98dc5be)
- Bootstrap openai client (c8120990b49188805a48dd9b35cd250722ea3308)
- Use OpenAI API and improve interactivity (48042197b62244ebb703b1931d1f2778cda2694f)
- Update requirements (33f4b8c7893308049ff86b0da3a5376c31ae0268)
- Add history (8362096a1d78aa658553bfe16002ab76fa0b132a)
- Implement proper buffering of the output (e8809f1d039d7a252ca230042d59a3eb268a6482)
- Update language handling and store logs (0e2092543ad57d4d1863a677fec5a761e935a76e)
- Handle case where the data for the country is empty. (5eb37d7a551259ccf4d20781f703d981ab8cee8f)
Files changed (5)
- mcp_openai_client.pyAdded+758
- mcp_remote_client.py+1-1
- pyproject.toml+1
- services.py+8
- uv.lock+21
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758import asyncioimport osimport jsonfrom typing import List, Dict, Any, Unionfrom contextlib import AsyncExitStackfrom datetime import datetimeimport gradio as grfrom gradio.components.chatbot import ChatMessagefrom mcp import ClientSession, StdioServerParametersfrom mcp.client.stdio import stdio_clientfrom mcp.client.sse import sse_clientfrom anthropic import Anthropicfrom anthropic._exceptions import OverloadedErrorfrom dotenv import load_dotenvfrom openai import OpenAIimport openaifrom openai.types.responses import ( ResponseTextDeltaEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, ResponseTextDoneEvent, ResponseMcpCallInProgressEvent, ResponseAudioDeltaEvent, ResponseMcpCallCompletedEvent, ResponseOutputItemDoneEvent, ResponseOutputItemAddedEvent, ResponseCompletedEvent,)import ast
load_dotenv()
# LLM_PROVIDER = "anthropic"LLM_PROVIDER = "openai"
SYSTEM_PROMPT = f"""You are a helpful assistant. Today is {datetime.now().strftime("%Y-%m-%d")}.
You **do not** have prior knowledge of the World Development Indicators (WDI) data. Instead, you must rely entirely on the tools available to you to answer the user's questions.
Detect the language of the user's query and use that language for your response, unless the user specifies otherwise.
When responding you must always plan the steps and enumerate all the tools that you plan to use to answer the user's query.
### Your Instructions:
1. **Tool Use Only**: - You must not provide any answers based on prior knowledge or assumptions. - You must **not** fabricate data or simulate the behavior of the `get_wdi_data` tool. - You cannot use the `get_wdi_data` tool without using the `search_relevant_indicators` tool first. - If the user requests WDI data, you **MUST ALWAYS** first call the `search_relevant_indicators` tool to see if there's any relevant data. - If relevant data exists, call the `get_wdi_data` tool to get the data.
2. **Tool Invocation**: - Use any relevant tools provided to you to answer the user's question. - You may call multiple tools if needed, and you should do so in a logical sequence to minimize unnecessary user interaction. - Do not hesitate to invoke tools as soon as they are relevant.
3. **Limitations**: - If a user request cannot be fulfilled using the tools available, respond by clearly stating that you do not have access to that information.
4. **Ethical Guidelines**: - Do not make or endorse statements based on stereotypes, bias, or assumptions. - Ensure all claims and explanations are grounded in the data or factual evidence retrieved via tools. - Politely refuse to respond to requests that involve stereotypes or unfounded generalizations.
5. **Communication Style**: - Present the data in clear, user-friendly language. - You may summarize or explain the data retrieved, but do **not** elaborate based on outside or implicit knowledge. - You may describe the data in a way that is easy to understand but you MUST NOT elaborate based on external knowledge. - Provide summary of the answer in the last step describing some observations and insights solely based on the data.
6. **Presentation**: - Present the data in a way that is easy to understand. - Summarize the data in a table format with clear column names and values. - If the data is not available, respond by clearly stating that you do not have access to that information.
7. **Tool Use**: - Fetch each indicator data using independent tool calls. - Provide some brief explanation between tool calls.
Stay strictly within these boundaries while maintaining a helpful and respectful tone."""
LLM_MODEL = "claude-3-5-haiku-20241022"OPENAI_MODEL = "gpt-4.1"# OPENAI_MODEL = "gpt-4.1-mini"# OPENAI_MODEL = "gpt-4.1-nano"# What is the military spending of bangladesh in 2014?# When a tool is needed for any step, ensure to add the token `TOOL_USE`.
loop = asyncio.new_event_loop()asyncio.set_event_loop(loop)
class MCPClientWrapper: def __init__(self): self.session = None self.exit_stack = None self.anthropic = Anthropic() self.openai = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) self.tools = []
async def connect(self, server_path_or_url: str) -> str: try: # If there's an existing session, close it if self.exit_stack: return "Already connected to an MCP server. Please disconnect first." # await self.exit_stack.aclose()
self.exit_stack = AsyncExitStack()
if server_path_or_url.endswith(".py"): command = "python"
server_params = StdioServerParameters( command=command, args=[server_path_or_url], env={"PYTHONIOENCODING": "utf-8", "PYTHONUNBUFFERED": "1"}, )
print( f"Starting MCP server with command: {command} {server_path_or_url}" ) # Launch MCP subprocess and bind streams on the current running loop stdio_transport = await self.exit_stack.enter_async_context( stdio_client(server_params) ) self.stdio, self.write = stdio_transport else: print(f"Connecting to MCP server at: {server_path_or_url}") sse_transport = await self.exit_stack.enter_async_context( sse_client( server_path_or_url, headers={"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}, ) ) self.stdio, self.write = sse_transport
print("Creating MCP client session...") # Create ClientSession on this same loop self.session = await self.exit_stack.enter_async_context( ClientSession(self.stdio, self.write) ) await self.session.initialize() print("MCP session initialized successfully")
response = await self.session.list_tools() self.tools = [ { "name": tool.name, "description": tool.description, "input_schema": tool.inputSchema, } for tool in response.tools ]
print("Available tools:", self.tools) tool_names = [tool["name"] for tool in self.tools] return f"Connected to MCP server. Available tools: {', '.join(tool_names)}" except Exception as e: error_msg = f"Failed to connect to MCP server: {str(e)}" print(error_msg) # Clean up on error if self.exit_stack: await self.exit_stack.aclose() self.exit_stack = None self.session = None return error_msg
async def disconnect(self): if self.exit_stack: print("Disconnecting from MCP server...") await self.exit_stack.aclose() self.exit_stack = None self.session = None
async def process_message( self, message: str, history: List[Union[Dict[str, Any], ChatMessage]], previous_response_id: str = None, ): if not self.session and LLM_PROVIDER == "anthropic": messages = history + [ {"role": "user", "content": message}, { "role": "assistant", "content": "Please connect to an MCP server first by reloading the page.", }, ] yield messages, gr.Textbox(value=""), gr.Textbox(value=previous_response_id) else: messages = history + [ {"role": "user", "content": message}, { "role": "assistant", "content": "Ok, let me think about your query 🤔...", }, ]
yield messages, gr.Textbox(value=""), gr.Textbox(value=previous_response_id) # simulate thinking with asyncio.sleep await asyncio.sleep(0.1) messages.pop(-1)
is_delta = False async for partial in self._process_query( message, history, previous_response_id ): if partial[-1].get("delta"): if not is_delta: is_delta = True messages.append( { "role": "assistant", "content": "", } ) messages[-1]["content"] += partial[-1]["delta"] if partial[-1].get("status") == "done": await asyncio.sleep(0.05) else: is_delta = False if partial[-1].get("response_id"): previous_response_id = partial[-1]["response_id"] yield ( messages, gr.Textbox(value=""), gr.Textbox(value=previous_response_id), ) await asyncio.sleep(0.01) continue else: messages.extend(partial) print(partial)
yield ( messages, gr.Textbox(value=""), gr.Textbox(value=previous_response_id), ) await asyncio.sleep(0.01)
if ( messages[-1]["role"] == "assistant" and messages[-1]["content"] == "The LLM API is overloaded now, try again later..." ): break
with open("messages.log.jsonl", "a+") as fl: fl.write(json.dumps(dict(time=f"{datetime.now()}", messages=messages)))
async def _process_query_openai( self, message: str, history: List[Union[Dict[str, Any], ChatMessage]], previous_response_id: str = None, ): response = self.openai.responses.create( model=OPENAI_MODEL, tools=[ { "type": "mcp", "server_label": "wdi_mcp", "server_url": "https://avsolatorio-test-data-mcp-server.hf.space/gradio_api/mcp/sse", "require_approval": "never", "headers": {"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}, # "server_token": userdata.get('MCP_HF_TOKEN'), }, ], # input="What transport protocols are supported in the 2025-03-26 version of the MCP spec?", instructions=SYSTEM_PROMPT, # input="What is the gdp of india in 2020?", input=message, parallel_tool_calls=False, stream=True, max_output_tokens=32768, temperature=0, previous_response_id=previous_response_id if previous_response_id.strip() else None, store=True, # Store the response in the OpenAIlogs )
is_tool_call = False tool_name = None tool_args = None for event in response: if isinstance(event, ResponseCompletedEvent): yield [ { "response_id": event.response.id, } ] elif ( isinstance(event, ResponseOutputItemAddedEvent) and event.item.type == "mcp_call" ): is_tool_call = True tool_name = event.item.name # if isinstance(event, ResponseMcpCallInProgressEvent): # is_tool_call = True # yield [ # { # "role": "assistant", # "content": "I'll use the tool to help answer your question.", # } # ] if is_tool_call: if ( isinstance(event, ResponseAudioDeltaEvent) and event.type == "response.mcp_call_arguments.done" ): tool_args = event.arguments
try: tool_args = json.dumps( json.loads(tool_args), ensure_ascii=True, indent=2 ) except: pass
yield [ { "role": "assistant", "content": f"I'll use the {tool_name} tool to help answer your question.", "metadata": { "title": f"Using tool: {tool_name.replace('avsolatorio_test_data_mcp_server', '')}", "log": f"Parameters: {tool_args}", # "status": "pending", "status": "done", "id": f"tool_call_{tool_name}", }, } ]
yield [ { "role": "assistant", "content": "```json\n" + tool_args + "\n```", "metadata": { "parent_id": f"tool_call_{tool_name}", "id": f"params_{tool_name}", "title": "Tool Parameters", }, } ]
elif isinstance(event, ResponseOutputItemDoneEvent): if event.item.type == "mcp_call": yield [ { "role": "assistant", "content": "Here are the results from the tool:", "metadata": { "title": f"Tool Result for {tool_name.replace('avsolatorio_test_data_mcp_server', '')}", "status": "done", "id": f"result_{tool_name}", }, } ]
result_content = event.item.output if result_content.startswith("root="): result_content = result_content[5:] try: result_content = ast.literal_eval(result_content) result_content = json.dumps(result_content, indent=2) except: pass
yield [ { "role": "assistant", "content": "```\n" + result_content + "\n```", "metadata": { "parent_id": f"result_{tool_name}", "id": f"raw_result_{tool_name}", "title": "Raw Output", }, } ] is_tool_call = False tool_name = None tool_args = None
elif ( isinstance(event, ResponseContentPartDoneEvent) and event.type == "response.content_part.done" ): yield [ { "role": "assistant", "content": "", "delta": "", "status": "done", } ] elif isinstance(event, ResponseTextDeltaEvent): yield [{"role": "assistant", "content": None, "delta": event.delta}]
async def _process_query_anthropic( self, message: str, history: List[Union[Dict[str, Any], ChatMessage]] ): claude_messages = [] for msg in history: if isinstance(msg, ChatMessage): role, content = msg.role, msg.content else: role, content = msg.get("role"), msg.get("content")
if role in ["user", "assistant", "system"]: claude_messages.append({"role": role, "content": content})
claude_messages.append({"role": "user", "content": message})
try: response = self.anthropic.messages.create( # model="claude-3-5-sonnet-20241022", model=LLM_MODEL, system=SYSTEM_PROMPT, max_tokens=1000, messages=claude_messages, tools=self.tools, ) except OverloadedError: yield [ { "role": "assistant", "content": "The LLM API is overloaded now, try again later...", } ] # TODO: Add a retry mechanism
result_messages = [] partial_messages = []
print(response.content) contents = response.content
MAX_CALLS = 10 auto_calls = 0
while len(contents) > 0 and auto_calls < MAX_CALLS: content = contents.pop(0)
if content.type == "text": result_messages.append({"role": "assistant", "content": content.text}) claude_messages.append({"role": "assistant", "content": content.text}) partial_messages.append(result_messages[-1]) yield [result_messages[-1]] partial_messages = []
elif content.type == "tool_use": tool_id = content.id tool_name = content.name tool_args = content.input
result_messages.append( { "role": "assistant", "content": f"I'll use the {tool_name} tool to help answer your question.", "metadata": { "title": f"Using tool: {tool_name.replace('avsolatorio_test_data_mcp_server', '')}", "log": f"Parameters: {json.dumps(tool_args, ensure_ascii=True)}", # "status": "pending", "status": "done", "id": f"tool_call_{tool_name}", }, } ) partial_messages.append(result_messages[-1]) yield [result_messages[-1]]
result_messages.append( { "role": "assistant", "content": "```json\n" + json.dumps(tool_args, indent=2, ensure_ascii=True) + "\n```", "metadata": { "parent_id": f"tool_call_{tool_name}", "id": f"params_{tool_name}", "title": "Tool Parameters", }, } ) partial_messages.append(result_messages[-1]) yield [result_messages[-1]]
print(f"Calling tool: {tool_name} with args: {tool_args}") try: # Check if session is still valid if not self.session or not self.stdio or not self.write: raise Exception( "MCP session is not connected or has been closed" )
result = await self.session.call_tool(tool_name, tool_args) except Exception as e: error_msg = f"Error calling tool {tool_name}: {str(e)}" print(error_msg) result_messages.append( { "role": "assistant", "content": f"Sorry, I encountered an error while calling the tool: {error_msg}. Please try again or reload the page.", "metadata": { "title": f"Tool Error for {tool_name.replace('avsolatorio_test_data_mcp_server', '')}", "status": "done", "id": f"error_{tool_name}", }, } ) partial_messages.append(result_messages[-1]) yield [result_messages[-1]] partial_messages = [] continue
if result_messages and "metadata" in result_messages[-2]: result_messages[-2]["metadata"]["status"] = "done"
result_messages.append( { "role": "assistant", "content": "Here are the results from the tool:", "metadata": { "title": f"Tool Result for {tool_name.replace('avsolatorio_test_data_mcp_server', '')}", "status": "done", "id": f"result_{tool_name}", }, } ) partial_messages.append(result_messages[-1]) yield [result_messages[-1]] partial_messages = []
result_content = result.content print(result_content) if isinstance(result_content, list): result_content = [r.model_dump() for r in result_content]
for r in result_content: # Remove annotations field from each item if it exists r.pop("annotations", None) try: r["text"] = json.loads(r["text"]) except: pass
print("result_content", result_content)
result_messages.append( { "role": "assistant", "content": "```\n" + json.dumps(result_content, indent=2) + "\n```", "metadata": { "parent_id": f"result_{tool_name}", "id": f"raw_result_{tool_name}", "title": "Raw Output", }, } ) partial_messages.append(result_messages[-1]) yield [result_messages[-1]] partial_messages = []
claude_messages.append( {"role": "assistant", "content": [content.model_dump()]} ) claude_messages.append( { "role": "user", "content": [ { "type": "tool_result", "tool_use_id": tool_id, "content": json.dumps(result_content, indent=2), } ], } )
try: next_response = self.anthropic.messages.create( model=LLM_MODEL, system=SYSTEM_PROMPT, max_tokens=1000, messages=claude_messages, tools=self.tools, ) auto_calls += 1 except OverloadedError: yield [ { "role": "assistant", "content": "The LLM API is overloaded now, try again later...", } ]
print("next_response", next_response.content)
contents.extend(next_response.content)
async def _process_query( self, message: str, history: List[Union[Dict[Any, Any], ChatMessage]], previous_response_id: str = None, ): if LLM_PROVIDER == "anthropic": async for partial in self._process_query_anthropic(message, history): yield partial elif LLM_PROVIDER == "openai": try: async for partial in self._process_query_openai( message, history, previous_response_id ): yield partial except openai.APIError as e: print(e) yield [ { "role": "assistant", "content": "The LLM encountered an error. Please try again or reload the page.", } ] except Exception as e: print(e) yield [ { "role": "assistant", "content": f"Sorry, I encountered an unexpected error: `{e}`. Please try again or reload the page.", } ]
def gradio_interface( server_path_or_url: str = "https://avsolatorio-test-data-mcp-server.hf.space/gradio_api/mcp/sse",): # server_path_or_url = "https://avsolatorio-test-data-mcp-server.hf.space/gradio_api/mcp/sse" # server_path_or_url = "wdi_mcp_server.py"
client = MCPClientWrapper() custom_css = """ .gradio-container { background-color: #fff !important; } .message-row.panel.bot-row { background-color: #fff !important; } .message-row.panel.user-row { background-color: #fff !important; } .user { background-color: #f1f6ff !important; } .bot { background-color: #fff !important; } .role { margin-left: 10px !important; } footer{display:none !important} """
# Disable auto-dark mode by setting theme to None with gr.Blocks(title="WDI MCP Client", css=custom_css, theme=None) as demo: try: gr.Markdown("# Data360 Chat [Prototype]") # gr.Markdown("Connect to the WDI MCP server and chat with the assistant")
with gr.Accordion( "Connect to the WDI MCP server and chat with the assistant", open=False, visible=server_path_or_url.endswith(".py"), ): with gr.Row(equal_height=True): with gr.Column(scale=4): server_path = gr.Textbox( label="Server Script Path", placeholder="Enter path to server script (e.g., wdi_mcp_server.py)", value=server_path_or_url, ) with gr.Column(scale=1): connect_btn = gr.Button("Connect")
status = gr.Textbox(label="Connection Status", interactive=False)
chatbot = gr.Chatbot( value=[], height="81vh", type="messages", show_copy_button=False, avatar_images=("img/small-user.png", "img/small-robot.png"), autoscroll=True, layout="panel", placeholder="Ask development data questions!", ) previous_response_id = gr.Textbox( label="Previous Response ID", interactive=False, visible=False )
with gr.Row(equal_height=True): msg = gr.Textbox( label=None, placeholder="Ask about what indicators are available for a specific topic (e.g., What's the definition of GDP?)", scale=4, show_label=False, ) # clear_btn = gr.Button("Clear Chat", scale=1)
# connect_btn.click(client.connect, inputs=server_path, outputs=status) # Automatically call client.connect(...) as soon as the interface loads if LLM_PROVIDER == "anthropic": demo.load( fn=client.connect, inputs=server_path, outputs=status, show_progress="full", )
msg.submit( client.process_message, [msg, chatbot, previous_response_id], [chatbot, msg, previous_response_id], concurrency_limit=10, ) # clear_btn.click(lambda: [], None, chatbot)
except KeyboardInterrupt: if LLM_PROVIDER == "anthropic": print("Keyboard interrupt received. Disconnecting from MCP server...") asyncio.run(client.disconnect()) raise KeyboardInterrupt # demo.unload(client.disconnect)
return demo
if __name__ == "__main__": if not os.getenv("ANTHROPIC_API_KEY"): print( "Warning: ANTHROPIC_API_KEY not found in environment. Please set it in your .env file." )
# interface = gradio_interface(server_path_or_url="wdi_mcp_server.py") interface = gradio_interface( server_path_or_url="https://avsolatorio-test-data-mcp-server.hf.space/gradio_api/mcp/sse" ) interface.launch( server_name=os.getenv("SERVER_NAME", "127.0.0.1"), server_port=os.getenv("SERVER_PORT", 7860), debug=True, )424 unmodified lines425426427428429430431424 unmodified lines# Disable auto-dark mode by setting theme to Nonewith gr.Blocks(title="WDI MCP Client", css=custom_css, theme=None) as demo:try:gr.Markdown("# Development Data Chat")# gr.Markdown("Connect to the WDI MCP server and chat with the assistant")with gr.Accordion(424 unmodified lines425426427428429430431424 unmodified lines# Disable auto-dark mode by setting theme to Nonewith gr.Blocks(title="WDI MCP Client", css=custom_css, theme=None) as demo:try:gr.Markdown("# Data360 Chat [Prototype]")# gr.Markdown("Connect to the WDI MCP server and chat with the assistant")with gr.Accordion(
10 unmodified lines11121314151610 unmodified lines"httpx>=0.28.1","mcp>=1.10.0","numpy>=2.2.6","python-ulid>=3.0.0","scikit-learn>=1.6.1","sentence-transformers>=4.1.0",10 unmodified lines1112131415161710 unmodified lines"httpx>=0.28.1","mcp>=1.10.0","numpy>=2.2.6","openai>=1.93.1","python-ulid>=3.0.0","scikit-learn>=1.6.1","sentence-transformers>=4.1.0",
201 unmodified lines202203204205206207201 unmodified linesbreakmetadata, data_page = json_responseall_data.extend(data_page)if len(all_data) >= MAX_INFO:201 unmodified lines202203204205206207208209210211212213214215201 unmodified linesbreakmetadata, data_page = json_responseif data_page is None:if metadata.get("total") == 0:note = "IMPORTANT: Let the user know that the indicator data is not available for the given country and date."else:note = "ERROR: The API response is invalid or empty."breakall_data.extend(data_page)if len(all_data) >= MAX_INFO:
1214 unmodified lines1215121612171218121912201077 unmodified lines22982299230023012302230312 unmodified lines2316231723182319232023211214 unmodified lines{ url = "https://files.pythonhosted.org/packages/9e/4e/0d0c945463719429b7bd21dece907ad0bde437a2ff12b9b12fee94722ab0/nvidia_nvtx_cu12-12.6.77-py3-none-manylinux2014_x86_64.whl", hash = "sha256:6574241a3ec5fdc9334353ab8c479fe75841dbe8f4532a8fc97ce63503330ba1", size = 89265, upload-time = "2024-10-01T17:00:38.172Z" },][[package]]name = "orjson"version = "3.10.18"1077 unmodified lines{ name = "httpx" },{ name = "mcp" },{ name = "numpy" },{ name = "python-ulid" },{ name = "scikit-learn" },{ name = "sentence-transformers" },12 unmodified lines{ name = "httpx", specifier = ">=0.28.1" },{ name = "mcp", specifier = ">=1.10.0" },{ name = "numpy", specifier = ">=2.2.6" },{ name = "python-ulid", specifier = ">=3.0.0" },{ name = "scikit-learn", specifier = ">=1.6.1" },{ name = "sentence-transformers", specifier = ">=4.1.0" },1214 unmodified lines12151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391077 unmodified lines231723182319232023212322232312 unmodified lines23362337233823392340234123421214 unmodified lines{ url = "https://files.pythonhosted.org/packages/9e/4e/0d0c945463719429b7bd21dece907ad0bde437a2ff12b9b12fee94722ab0/nvidia_nvtx_cu12-12.6.77-py3-none-manylinux2014_x86_64.whl", hash = "sha256:6574241a3ec5fdc9334353ab8c479fe75841dbe8f4532a8fc97ce63503330ba1", size = 89265, upload-time = "2024-10-01T17:00:38.172Z" },][[package]]name = "openai"version = "1.93.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "anyio" },{ name = "distro" },{ name = "httpx" },{ name = "jiter" },{ name = "pydantic" },{ name = "sniffio" },{ name = "tqdm" },{ name = "typing-extensions" },]sdist = { url = "https://files.pythonhosted.org/packages/5e/a8/e4427729da048cb33bda15e70f09f7520bdf3577bafc546b135ecb36af7d/openai-1.93.1.tar.gz", hash = "sha256:11eb8932965d0f79ecc4cb38a60a0c4cef4bcd5fcf08b99fc9a399fa5f1e50ab", size = 487124, upload-time = "2025-07-07T16:40:38.389Z" }wheels = [{ url = "https://files.pythonhosted.org/packages/64/4f/875e5af1fb4e5ed4ea9e4a88f482d9ca2e48932105605b6c516e9a14de25/openai-1.93.1-py3-none-any.whl", hash = "sha256:a2c2946c4f21346d4902311a7440381fd8a33466ee7ca688133d1cad29a9357c", size = 755081, upload-time = "2025-07-07T16:40:36.585Z" },][[package]]name = "orjson"version = "3.10.18"1077 unmodified lines{ name = "httpx" },{ name = "mcp" },{ name = "numpy" },{ name = "openai" },{ name = "python-ulid" },{ name = "scikit-learn" },{ name = "sentence-transformers" },12 unmodified lines{ name = "httpx", specifier = ">=0.28.1" },{ name = "mcp", specifier = ">=1.10.0" },{ name = "numpy", specifier = ">=2.2.6" },{ name = "openai", specifier = ">=1.93.1" },{ name = "python-ulid", specifier = ">=3.0.0" },{ name = "scikit-learn", specifier = ">=1.6.1" },{ name = "sentence-transformers", specifier = ">=4.1.0" },
mcp_openai_client.pyAdded+758
mcp_remote_client.py+1-1
pyproject.toml+1
services.py+8
uv.lock+21