-
Notifications
You must be signed in to change notification settings - Fork 0
Fix ts evaluations #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a824b6f
5b5481c
161af68
76aa06e
59cee5d
980a76f
422b05d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ dist-ssr | |
| .venv | ||
| *.python-version | ||
| *.env | ||
| openshift-images/ | ||
|
|
||
| # Python cache | ||
| __pycache__/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ class Settings(BaseSettings): | |
|
|
||
| # Agent MCP service URL (internal service-to-service) | ||
| AGENT_URL: str = "http://localhost:8001" | ||
|
|
||
| EVALUATION_SERVICE_URL: str = "http://localhost:8001" | ||
| OPENMETADATA_TOKEN: str = "" | ||
|
|
||
| APP_ENV: str = "development" | ||
|
|
@@ -52,8 +52,9 @@ class Settings(BaseSettings): | |
| JWT_EXPIRE_HOURS: int = 8 | ||
|
|
||
| # Embedder Config | ||
| EMBEDDER_URL: str = "http://host.docker.internal:11434/api/embeddings" | ||
| EMBEDDER_URL: str = "http://host.docker.internal:11434/v1/embeddings" | ||
| EMBEDDER_MODEL: str = "nomic-embed-text:latest" | ||
| EMBEDDER_KEY: str = "" | ||
|
Comment on lines
+55
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n backend/app/config.py | head -100Repository: StavPonte11/text2sql-onboarding Length of output: 2645 🏁 Script executed: cat -n backend/app/config.py | tail -20Repository: StavPonte11/text2sql-onboarding Length of output: 902 🏁 Script executed: wc -l backend/app/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 100 🏁 Script executed: rg "EMBEDDER_URL" -A 3 -B 3Repository: StavPonte11/text2sql-onboarding Length of output: 3384 🏁 Script executed: cat -n backend/app/config.py && echo "---" && cat -n agent/src/agent/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 4174 🏁 Script executed: rg "field_validator|Field\(" backend/app/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: rg "field_validator|`@validator`" backend/app/ && echo "---FOUND---" || echo "---NO VALIDATORS FOUND---"Repository: StavPonte11/text2sql-onboarding Length of output: 101 🏁 Script executed: cat -n backend/app/seed.py | grep -A 10 "def get_embedding"Repository: StavPonte11/text2sql-onboarding Length of output: 711 🏁 Script executed: rg "http|https|scheme" backend/app/ -i | grep -i "valid\|check\|assert" | head -20Repository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: rg "urllib.*parse|urlparse|HttpUrl|AnyUrl" backend/app/Repository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: rg "from pydantic" backend/app/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 138 🏁 Script executed: rg "HttpUrl|AnyUrl|field_validator" --type pythonRepository: StavPonte11/text2sql-onboarding Length of output: 106 🏁 Script executed: rg "HttpUrl|AnyUrl|field_validator" -t pyRepository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: git log --oneline --all -S "EMBEDDER_URL" | head -5Repository: StavPonte11/text2sql-onboarding Length of output: 202 🏁 Script executed: cat -n backend/app/routers/tables.py | grep -A 5 -B 5 "EMBEDDER_URL"Repository: StavPonte11/text2sql-onboarding Length of output: 1010 🏁 Script executed: git log --all --oneline | head -20Repository: StavPonte11/text2sql-onboarding Length of output: 1031 🏁 Script executed: git log -p --all -S "field_validator" --reverse | head -50Repository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: git show 5e7aea0 --statRepository: StavPonte11/text2sql-onboarding Length of output: 456 🏁 Script executed: git show 462eb08Repository: StavPonte11/text2sql-onboarding Length of output: 958 🏁 Script executed: rg "http" backend/app/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 450 🏁 Script executed: rg "startswith.*http\|http.*startswith\|scheme" backend/app/ agent/src/Repository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: rg "ValueError|raise.*Error" backend/app/config.py agent/src/agent/config.pyRepository: StavPonte11/text2sql-onboarding Length of output: 57 🏁 Script executed: rg "model_validate\|field_validator\|validator" -t py | head -20Repository: StavPonte11/text2sql-onboarding Length of output: 57 Add HTTP(S) scheme validation to The 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| settings = Settings() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
|
|
||
| from fastapi import APIRouter, HTTPException | ||
| from mcp.client.session import ClientSession | ||
| from mcp.client.sse import sse_client | ||
| from mcp.client.streamable_http import streamablehttp_client | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check the mcp version declared in backend dependencies
fd -i "requirements" --exec cat {} \; 2>/dev/null
fd -i "pyproject.toml" --exec cat {} \; 2>/dev/nullRepository: StavPonte11/text2sql-onboarding Length of output: 4198 🌐 Web query:
💡 Result: The Citations:
🌐 Web query:
💡 Result: The function Citations:
🏁 Script executed: # Search for any documentation or changelog that might specify when streamablehttp_client was available
cd backend && git log --oneline --all --grep="streamable" 2>/dev/null | head -20 || echo "Git not available"Repository: StavPonte11/text2sql-onboarding Length of output: 57 Use The function from mcp.client.streamable_http import streamable_http_client🤖 Prompt for AI Agents |
||
| from pydantic import BaseModel | ||
|
|
||
| from app.config import settings | ||
|
|
@@ -60,15 +60,15 @@ class ChatResponse(BaseModel): | |
|
|
||
| async def _call_agent_mcp(tool_arguments: dict) -> dict: | ||
| """ | ||
| Connects to the agent MCP server over SSE, initializes the session, | ||
| Connects to the agent MCP server over Streamable HTTP, initializes the session, | ||
| calls the 'chat_with_agent' tool, and returns the parsed result. | ||
| """ | ||
| url = f"{settings.AGENT_URL}/sse" | ||
| url = f"{settings.AGENT_URL}/mcp" | ||
| logger.debug("Connecting to agent MCP: %s args=%s", url, tool_arguments) | ||
|
|
||
| try: | ||
| async with sse_client(url) as streams: | ||
| async with ClientSession(*streams) as session: | ||
| async with streamablehttp_client(url) as (read_stream, write_stream, _): | ||
| async with ClientSession(read_stream, write_stream) as session: | ||
| await session.initialize() | ||
|
|
||
| # Call the tool using the MCP client session | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: StavPonte11/text2sql-onboarding
Length of output: 1600
🏁 Script executed:
rg -A 5 -B 5 "EMBEDDER_URL" --type pyRepository: StavPonte11/text2sql-onboarding
Length of output: 4453
🏁 Script executed:
rg "from pydantic" agent/src/agent/config.pyRepository: StavPonte11/text2sql-onboarding
Length of output: 165
Constrain
EMBEDDER_URLto HTTP(S) at settings load time.Line 12 keeps
EMBEDDER_URLas an unconstrainedstr, allowing unsafe URL schemes (ftp, file, etc.) to be passed to embedder callers. The value is directly consumed byurllib.request.Requestandhttpx.postwithout scheme validation. Use Pydantic'sAnyHttpUrltype to enforce HTTP/HTTPS schemes at configuration initialization and fail fast on misconfiguration.Suggested hardening
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Linters/SAST tools