| Framework | MCP integration | Tool filtering? | Example |
|---|---|---|---|
| Langchain | MultiServerMCPClient accepts a dictionary of MCP servers | Filter with get_tools() after connecting to servers | Example |
| Agent-framework | MCPStreamableHTTPTool for each MCP server | Filter with allowed_tools on that class, or tools on agent.run() | Example |
| Pydantic AI | MCPServerStreamableHTTP for each MCP server | Apply .filtered() method to the server and use result as a toolset for agent |
Example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import json | |
| import os | |
| from azure.ai.evaluation import AzureOpenAIModelConfiguration, IntentResolutionEvaluator | |
| from azure.identity import DefaultAzureCredential, get_bearer_token_provider | |
| from dotenv import load_dotenv | |
| from agentframework_learn import run_agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ------------------- Stage 0: Base Stage ------------------------------ | |
| FROM python:3.13-alpine AS base | |
| # Install tini, a tiny init for containers | |
| RUN apk add --update --no-cache tini | |
| # Install required packages for cryptography and ml-dtypes packages | |
| # https://cryptography.io/en/latest/installation/#building-cryptography-on-linux | |
| RUN apk add gcc g++ musl-dev python3-dev libffi-dev openssl-dev cargo pkgconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from anthropic import AnthropicFoundry | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| endpoint = "https://pf-claude-foundry-proje-resource.openai.azure.com/anthropic" | |
| deployment_name = "claude-sonnet-4-5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Compare documents across two Azure AI Search indexes""" | |
| import argparse | |
| import asyncio | |
| import logging | |
| import os | |
| from collections.abc import Iterable, Mapping | |
| from dataclasses import dataclass, field | |
| from typing import Any, cast |
Derived from the original PRD but intentionally simplified for fastest viable implementation. Focus: “folder in, article out” with minimal config, vision-first extraction, and straightforward alignment (no embeddings initially).
Goal: Given a folder containing a deck.pptx (and optionally a transcript + config.yaml), produce article.md plus slide images using a simple CLI: talk2article <folder>.
Included in MVP:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from langchain.agents.middleware import AgentMiddleware, AgentState, ModelRequest | |
| class ToolCallLimitMiddleware(AgentMiddleware): | |
| def __init__(self, limit) -> None: | |
| super().__init__() | |
| self.limit = limit | |
| def modify_model_request( | |
| self, request: ModelRequest, state: AgentState | |
| ) -> ModelRequest: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| import azure.identity | |
| import openai | |
| from dotenv import load_dotenv | |
| from rich import print | |
| # Setup the OpenAI client to use either Azure, OpenAI.com, or Ollama API | |
| load_dotenv(override=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Find characters whose repetitions tokenize to one token per character with tiktoken. | |
| A character c is considered "stable single-token" if: | |
| len(encode(c)) == 1 AND for all k in [1, max_reps], len(encode(c * k)) == k. | |
| Usage (from repo root with virtual env active): | |
| python find_single_token_char.py | |
| python find_single_token_char.py --model text-embedding-3-large --max-reps 32 |
NewerOlder