Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ Interactive demo for [ignfab/geocontext](https://github.com/ignfab/geocontext#re

## Parameters

| Name | Description | Default |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| MODEL_NAME | The name of the model (see [LangGraph - create_react_agent](https://langchain-ai.github.io/langgraph/agents/models/#use-in-an-agent) / [init_chat_model](https://python.langchain.com/api_reference/langchain/chat_models/langchain.chat_models.base.init_chat_model.html)) | "anthropic:claude-3-7-sonnet-latest" |
| ANTHROPIC_API_KEY | Required from `anthropic:*` models (https://console.anthropic.com/settings/keys) | |
| GOOGLE_API_KEY | Required from `google_genai:*` models (https://aistudio.google.com/api-keys) | |
| TEMPERATURE | Model temperature | 0 |
| DB_URI | URL of the PostgreSQL (`postgresql://postgres:ChangeIt@localhost:5432/geocontext`) or Redis (ex : `redis://default:ChangeIt@localhost:6379/0`) database. | None (use InMemorySaver) |
| CONTACT_EMAIL | Email for the contact button. | "dev@localhost" |
| Name | Description | Default |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| MODEL_NAME | The name of the model (see [LangGraph - create_react_agent](https://langchain-ai.github.io/langgraph/agents/models/#use-in-an-agent) / [init_chat_model](https://python.langchain.com/api_reference/langchain/chat_models/langchain.chat_models.base.init_chat_model.html)) | "anthropic:claude-3-7-sonnet-latest" |
| ANTHROPIC_API_KEY | Required from `anthropic:*` models (https://console.anthropic.com/settings/keys) | |
| GOOGLE_API_KEY | Required from `google_genai:*` models (https://aistudio.google.com/api-keys) | |
| TEMPERATURE | Model temperature | 0 |
| DB_URI | URL of the PostgreSQL (`postgresql://postgres:ChangeIt@localhost:5432/geocontext`) or Redis (ex : `redis://default:ChangeIt@localhost:6379/0`) database. | None (use InMemorySaver) |
| CONTACT_EMAIL | Email for the contact button. | "dev@localhost" |
| GEOCONTEXT_LOG_LEVEL | Log level for Geocontext MCP. | error |
| LOG_LEVEL | Log level for this application. | INFO |

> Note that "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY" are supported if you have to use a corporate proxy.

Expand Down
5 changes: 3 additions & 2 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ async def build_graph(checkpointer=InMemorySaver()) -> CompiledStateGraph:
env = os.environ.copy()
proxy_vars = ["HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"]
proxy_env = {var: env[var] for var in proxy_vars if var in env}

log_level = env.get("GEOCONTEXT_LOG_LEVEL", "error")

client = MultiServerMCPClient(
{
"geocontext": {
"command": "npx",
"args": ["-y", "@ignfab/geocontext"],
"transport": "stdio",
"env": {**proxy_env, "LOG_LEVEL": "error"} if proxy_env else {"LOG_LEVEL": "error"}
"env": {**proxy_env, "LOG_LEVEL": log_level} if proxy_env else {"LOG_LEVEL": log_level}
},
"time": {
"command": "uvx",
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
- NO_PROXY=${NO_PROXY:-127.0.0.1,localhost}
- DB_URI=postgresql://geocontext:${PGPASSWORD:-ChangeIt}@db:5432/geocontext
- CONTACT_EMAIL=${CONTACT_EMAIL:-dev@localhost}
- GEOCONTEXT_LOG_LEVEL=${GEOCONTEXT_LOG_LEVEL:-error}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
read_only: true
volumes:
- site-tmp:/tmp
Expand Down