OppaAI commited on
Commit
cebdf97
·
verified ·
1 Parent(s): 6983d82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -5,26 +5,23 @@ import gradio as gr
5
  from pydantic_ai import Agent
6
  from pydantic_ai.mcp import MCPServerHTTP
7
  from pydantic_ai.models.openai import OpenAIModel
8
- from pydantic_ai.providers.openai import OpenAIProvider
9
 
10
  # MCP Server SSE URL
11
  SSE_URL = "https://oppaai-job-search-mcp-server.hf.space/gradio_api/mcp/sse"
12
  server = MCPServerHTTP(url=SSE_URL)
13
 
14
- HF_TOKEN = os.getenv("HF_TOKEN") # Make sure your HF_TOKEN is set in environment variables
15
 
16
- # Use HuggingFace hosted Qwen3-30B-A3B model
17
- qwen3_model = OpenAIModel(
18
- model_name="Qwen/Qwen3-30B-A3B",
19
- provider=OpenAIProvider(
20
- base_url="https://api-inference.huggingface.co/models/Qwen/Qwen3-30B-A3B",
21
- token=HF_TOKEN,
22
- ),
23
  )
24
 
25
  # Create Agent with MCP Server
26
  agent = Agent(
27
- model=qwen3_model,
28
  mcp_servers=[server],
29
  instructions="""
30
  Your name is Jobcy. You are an AI assistant designed to help users to find remote jobs by searching through job listings from various sources, including the Jobicy API and other platforms.
 
5
  from pydantic_ai import Agent
6
  from pydantic_ai.mcp import MCPServerHTTP
7
  from pydantic_ai.models.openai import OpenAIModel
8
+ from pydantic_ai.providers.openrouter import OpenRouterProvider
9
 
10
  # MCP Server SSE URL
11
  SSE_URL = "https://oppaai-job-search-mcp-server.hf.space/gradio_api/mcp/sse"
12
  server = MCPServerHTTP(url=SSE_URL)
13
 
14
+ OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY") # Make sure your HF_TOKEN is set in environment variables
15
 
16
+ # Use OpenRouter hosted LLM Qwen3-30B-A3B model
17
+ model = OpenAIModel(
18
+ 'qwen/qwen3-235b-a22b:free',
19
+ provider=OpenRouterProvider(api_key=OPENROUTER_API_KEY),
 
 
 
20
  )
21
 
22
  # Create Agent with MCP Server
23
  agent = Agent(
24
+ model=model,
25
  mcp_servers=[server],
26
  instructions="""
27
  Your name is Jobcy. You are an AI assistant designed to help users to find remote jobs by searching through job listings from various sources, including the Jobicy API and other platforms.