diff --git a/.devcontainer/ollama/devcontainer.json b/.devcontainer/ollama/devcontainer.json index 22ac1a9..418096a 100644 --- a/.devcontainer/ollama/devcontainer.json +++ b/.devcontainer/ollama/devcontainer.json @@ -9,10 +9,10 @@ "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/azure/azure-dev/azd:latest": {}, "ghcr.io/prulloac/devcontainer-features/ollama:1": { - "pull": "qwen3.5:9b" + "pull": "gemma4:e2b" } }, - "postCreateCommand": "uv sync && cp .env.sample.ollama .env", + "postCreateCommand": "uv sync && uv run prek install && cp .env.sample.ollama .env", "forwardPorts": [6277, 6274], "portsAttributes": { "6277": { diff --git a/.env-sample b/.env-sample index 3d9c3e6..963ae9f 100644 --- a/.env-sample +++ b/.env-sample @@ -7,7 +7,7 @@ AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/ AZURE_OPENAI_CHAT_DEPLOYMENT=your-deployment-name # Ollama Configuration -OLLAMA_MODEL=qwen3.5:9b +OLLAMA_MODEL=gemma4:e2b OLLAMA_ENDPOINT=http://localhost:11434/v1 OLLAMA_API_KEY=no-key-needed diff --git a/.env.sample.ollama b/.env.sample.ollama index 341ef4f..0821870 100644 --- a/.env.sample.ollama +++ b/.env.sample.ollama @@ -2,7 +2,7 @@ API_HOST=ollama # Ollama Configuration -OLLAMA_MODEL=qwen3.5:9b +OLLAMA_MODEL=gemma4:e2b OLLAMA_ENDPOINT=http://localhost:11434/v1 OLLAMA_API_KEY=no-key-needed diff --git a/README.md b/README.md index 73c4fa2..30290ea 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ You can run this project virtually by using GitHub Codespaces. Click one of the [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/python-mcp-demos?devcontainer_path=.devcontainer/ollama/devcontainer.json) -The Ollama Codespace pre-installs Ollama and pulls the `qwen3.5:9b` model, and copies `.env.sample.ollama` as your `.env` file. Note that the 64GB memory requirement will consume your Codespace quota faster. +The Ollama Codespace pre-installs Ollama and pulls the `gemma4:e2b` model, and copies `.env.sample.ollama` as your `.env` file. Note that the 64GB memory requirement will consume your Codespace quota faster. Once the Codespace is open, open a terminal window and continue with the deployment steps. diff --git a/agents/agentframework_http.py b/agents/agentframework_http.py index dd3b127..cb8630f 100644 --- a/agents/agentframework_http.py +++ b/agents/agentframework_http.py @@ -39,7 +39,7 @@ client = OpenAIResponsesClient( base_url=os.environ.get("OLLAMA_ENDPOINT", "http://localhost:11434/v1"), api_key=os.getenv("OLLAMA_API_KEY", "no-key-needed"), - model_id=os.environ.get("OLLAMA_MODEL", "qwen3.5:9b"), + model_id=os.environ.get("OLLAMA_MODEL", "gemma4:e2b"), ) elif API_HOST == "openai": client = OpenAIResponsesClient( diff --git a/agents/agentframework_learn.py b/agents/agentframework_learn.py index 67a3c6f..9aa5a21 100644 --- a/agents/agentframework_learn.py +++ b/agents/agentframework_learn.py @@ -32,7 +32,7 @@ client = OpenAIResponsesClient( base_url=os.environ.get("OLLAMA_ENDPOINT", "http://localhost:11434/v1"), api_key=os.getenv("OLLAMA_API_KEY", "no-key-needed"), - model_id=os.environ.get("OLLAMA_MODEL", "qwen3.5:9b"), + model_id=os.environ.get("OLLAMA_MODEL", "gemma4:e2b"), ) elif API_HOST == "openai": client = OpenAIResponsesClient( @@ -58,7 +58,7 @@ async def http_mcp_example() -> None: tools=[mcp_server], ) as agent, ): - query = "How to create an Azure storage account using az cli?" + query = "What are the available hosting options for a Python web app on Azure? Compare them briefly." result = await agent.run(query) print(result.text) diff --git a/agents/langchainv1_github.py b/agents/langchainv1_github.py index ab8fe6e..0b623ed 100644 --- a/agents/langchainv1_github.py +++ b/agents/langchainv1_github.py @@ -36,7 +36,7 @@ ) elif API_HOST == "ollama": model = ChatOpenAI( - model=os.environ.get("OLLAMA_MODEL", "qwen3.5:9b"), + model=os.environ.get("OLLAMA_MODEL", "gemma4:e2b"), base_url=os.environ.get("OLLAMA_ENDPOINT", "http://localhost:11434/v1"), api_key=SecretStr(os.getenv("OLLAMA_API_KEY", "no-key-needed")), use_responses_api=True, @@ -92,7 +92,7 @@ async def main(): agent = create_agent( model, tools=filtered_tools, - prompt="You help users research GitHub repositories. Search and analyze information.", + system_prompt="You help users research GitHub repositories. Search and analyze information.", ) query = "Make a list of last 5 issues from the 'PrefectHQ/FastMCP' repository that discuss auth." diff --git a/agents/langchainv1_http.py b/agents/langchainv1_http.py index d4230bb..0d62b9e 100644 --- a/agents/langchainv1_http.py +++ b/agents/langchainv1_http.py @@ -38,7 +38,7 @@ ) elif API_HOST == "ollama": base_model = ChatOpenAI( - model=os.environ.get("OLLAMA_MODEL", "qwen3.5:9b"), + model=os.environ.get("OLLAMA_MODEL", "gemma4:e2b"), base_url=os.environ.get("OLLAMA_ENDPOINT", "http://localhost:11434/v1"), api_key=SecretStr(os.getenv("OLLAMA_API_KEY", "no-key-needed")), use_responses_api=True, diff --git a/pyproject.toml b/pyproject.toml index ff6bf7a..947f8af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,14 @@ requires-python = "==3.13.*" dependencies = [ "fastmcp>=3.0.0", "debugpy>=1.8.0", - "langchain-core>=0.3.0", + "langchain-core>=1.2.26", "mcp>=1.3.0", "azure-identity>=1.25.1", "msgraph-sdk>=1.0.0", "dotenv-azd>=0.1.0", - "langchain>=1.0.0", - "langchain-openai>=1.0.1", - "langchain-mcp-adapters>=0.1.11", + "langchain>=1.2.15", + "langchain-openai>=1.1.12", + "langchain-mcp-adapters>=0.2.2", "azure-ai-agents>=1.1.0", "agent-framework-core==1.0.0rc5", "azure-cosmos>=4.9.0", diff --git a/spanish/README.md b/spanish/README.md index bfee1ca..b370828 100644 --- a/spanish/README.md +++ b/spanish/README.md @@ -35,7 +35,7 @@ Puedes ejecutar este proyecto de forma virtual usando GitHub Codespaces. Haz cli [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/python-mcp-demos?devcontainer_path=.devcontainer/ollama/devcontainer.json) -El Codespace de Ollama pre-instala Ollama y descarga el modelo `qwen3.5:9b`, y copia `.env.sample.ollama` como tu archivo `.env`. Ten en cuenta que el requisito de 64GB de memoria consumirá tu cuota de Codespace más rápido. +El Codespace de Ollama pre-instala Ollama y descarga el modelo `gemma4:e2b`, y copia `.env.sample.ollama` como tu archivo `.env`. Ten en cuenta que el requisito de 64GB de memoria consumirá tu cuota de Codespace más rápido. Una vez abierto el Codespace, abre una terminal y continúa con los pasos de despliegue. diff --git a/uv.lock b/uv.lock index 935a7fd..9473dd2 100644 --- a/uv.lock +++ b/uv.lock @@ -914,21 +914,21 @@ wheels = [ [[package]] name = "langchain" -version = "1.2.14" +version = "1.2.15" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "langchain-core" }, { name = "langgraph" }, { name = "pydantic" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/af/2b/0ca77ee988a9f1c1f1d923115d7c91221ab434067bc36f2f637201aeee81/langchain-1.2.14.tar.gz", hash = "sha256:fc5511e8f8af7efee9e5a144da4392d700d627b301d240470db97272940ad317", size = 574190, upload-time = "2026-03-31T13:50:37.398Z" } +sdist = { url = "https://files.pythonhosted.org/packages/98/3f/888a7099d2bd2917f8b0c3ffc7e347f1e664cf64267820b0b923c4f339fc/langchain-1.2.15.tar.gz", hash = "sha256:1717b6719daefae90b2728314a5e2a117ff916291e2862595b6c3d6fba33d652", size = 574732, upload-time = "2026-04-03T14:26:03.994Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/4c/87/324ae5fd9993f024339a452fc89e3fd808bccde87ef95c8dafab3de023c0/langchain-1.2.14-py3-none-any.whl", hash = "sha256:96da6d7338d5a6fc41eb4ec0db83f7ef5d03bb5efd17bb269f34ba4378ebdb4d", size = 112715, upload-time = "2026-03-31T13:50:35.997Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e8/a3b8cb0005553f6a876865073c81ef93bd7c5b18381bcb9ba4013af96ebc/langchain-1.2.15-py3-none-any.whl", hash = "sha256:e349db349cb3e9550c4044077cf90a1717691756cc236438404b23500e615874", size = 112714, upload-time = "2026-04-03T14:26:02.557Z" }, ] [[package]] name = "langchain-core" -version = "1.2.24" +version = "1.2.26" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "jsonpatch" }, @@ -940,9 +940,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "uuid-utils" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/83/5a/6038561335ae6bf1ff096e7d9e29927995ed61c4723a7e282d6270b978fb/langchain_core-1.2.24.tar.gz", hash = "sha256:9f9bc085cffb6471d0f9878dc3c083cd74d33a70d3bd03bb6dbc6107b9afd9c8", size = 841888, upload-time = "2026-04-01T20:00:45.968Z" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/b0/30ed29e5820580bc13d70b1f8a212b4fe0609a9737164ed1a90167941ca2/langchain_core-1.2.26.tar.gz", hash = "sha256:ba025ec70e19b56467f46b9109de19d30d169d328a174986b353cb23fd0ff0fe", size = 844795, upload-time = "2026-04-03T23:30:32.567Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/99/7a/88c66ffaa0c1a262e39e3933af4d0a568c69453b73467377f4d42c7bd6bf/langchain_core-1.2.24-py3-none-any.whl", hash = "sha256:9b5b41cf55ac9907a3b6a61ce36ce77efe87ef1e163fac9a0deced8a69392472", size = 506781, upload-time = "2026-04-01T20:00:44.446Z" }, + { url = "https://files.pythonhosted.org/packages/e5/8b/c184205a52b37a4a3166b3567323495701929b1dbfd528e5ba1df62bd404/langchain_core-1.2.26-py3-none-any.whl", hash = "sha256:3d0a3913dff77a930b017a05afe979e4959d27bec0c77ee51f9a100754510509", size = 508298, upload-time = "2026-04-03T23:30:30.253Z" }, ] [[package]] @@ -975,7 +975,7 @@ wheels = [ [[package]] name = "langgraph" -version = "1.1.4" +version = "1.1.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "langchain-core" }, @@ -985,9 +985,9 @@ dependencies = [ { name = "pydantic" }, { name = "xxhash" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c0/ba/8a8f48ca1248ecff4844cb27247d10a85f05b4ac6b903298d36b2ca090fd/langgraph-1.1.4.tar.gz", hash = "sha256:c951a859f68a021c69a27500db4eafc1900fc7ac32a54f7fc31d277165d04bed", size = 545440, upload-time = "2026-03-31T12:56:45.344Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5c/e5/d3f72ead3c7f15769d5a9c07e373628f1fbaf6cbe7735694d7085859acf6/langgraph-1.1.6.tar.gz", hash = "sha256:1783f764b08a607e9f288dbcf6da61caeb0dd40b337e5c9fb8b412341fbc0b60", size = 549634, upload-time = "2026-04-03T19:01:32.561Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d0/74/22ea4734247b59e7c98e575e31a1f463366b084e0dc83cf63715b079ff28/langgraph-1.1.4-py3-none-any.whl", hash = "sha256:77ebe7ed44a2699f13696bf41f1dabe7b5fa8e6ad51e3597f2f175492e8f3656", size = 168190, upload-time = "2026-03-31T12:56:44.221Z" }, + { url = "https://files.pythonhosted.org/packages/71/e6/b36ecdb3ff4ba9a290708d514bae89ebbe2f554b6abbe4642acf3fddbe51/langgraph-1.1.6-py3-none-any.whl", hash = "sha256:fdbf5f54fa5a5a4c4b09b7b5e537f1b2fa283d2f0f610d3457ddeecb479458b9", size = 169755, upload-time = "2026-04-03T19:01:30.686Z" }, ] [[package]] @@ -1005,15 +1005,15 @@ wheels = [ [[package]] name = "langgraph-prebuilt" -version = "1.0.8" +version = "1.0.9" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "langchain-core" }, { name = "langgraph-checkpoint" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/0d/06/dd61a5c2dce009d1b03b1d56f2a85b3127659fdddf5b3be5d8f1d60820fb/langgraph_prebuilt-1.0.8.tar.gz", hash = "sha256:0cd3cf5473ced8a6cd687cc5294e08d3de57529d8dd14fdc6ae4899549efcf69", size = 164442, upload-time = "2026-02-19T18:14:39.083Z" } +sdist = { url = "https://files.pythonhosted.org/packages/99/4c/06dac899f4945bedb0c3a1583c19484c2cc894114ea30d9a538dd270086e/langgraph_prebuilt-1.0.9.tar.gz", hash = "sha256:93de7512e9caade4b77ead92428f6215c521fdb71b8ffda8cd55f0ad814e64de", size = 165850, upload-time = "2026-04-03T14:06:37.721Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/dc/41/ec966424ad3f2ed3996d24079d3342c8cd6c0bd0653c12b2a917a685ec6c/langgraph_prebuilt-1.0.8-py3-none-any.whl", hash = "sha256:d16a731e591ba4470f3e313a319c7eee7dbc40895bcf15c821f985a3522a7ce0", size = 35648, upload-time = "2026-02-19T18:14:37.611Z" }, + { url = "https://files.pythonhosted.org/packages/1d/a2/8368ac187b75e7f9d938ca075d34f116683f5cfc48d924029ee79aea147b/langgraph_prebuilt-1.0.9-py3-none-any.whl", hash = "sha256:776c8e3154a5aef5ad0e5bf3f263f2dcaab3983786cc20014b7f955d99d2d1b2", size = 35958, upload-time = "2026-04-03T14:06:36.58Z" }, ] [[package]] @@ -2038,10 +2038,10 @@ requires-dist = [ { name = "debugpy", specifier = ">=1.8.0" }, { name = "dotenv-azd", specifier = ">=0.1.0" }, { name = "fastmcp", specifier = ">=3.0.0" }, - { name = "langchain", specifier = ">=1.0.0" }, - { name = "langchain-core", specifier = ">=0.3.0" }, - { name = "langchain-mcp-adapters", specifier = ">=0.1.11" }, - { name = "langchain-openai", specifier = ">=1.0.1" }, + { name = "langchain", specifier = ">=1.2.15" }, + { name = "langchain-core", specifier = ">=1.2.26" }, + { name = "langchain-mcp-adapters", specifier = ">=0.2.2" }, + { name = "langchain-openai", specifier = ">=1.1.12" }, { name = "logfire", specifier = ">=4.15.1" }, { name = "mcp", specifier = ">=1.3.0" }, { name = "msgraph-sdk", specifier = ">=1.0.0" },