repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-azure-translate/tests/test_tools_azure_translate.py | llama-index-integrations/tools/llama-index-tools-azure-translate/tests/test_tools_azure_translate.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.azure_translate import AzureTranslateToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in AzureTranslateToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-azure-translate/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-azure-translate/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/__init__.py | llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/__init__.py | ## init
from llama_index.tools.azure_translate.base import (
ENDPOINT_BASE_URL,
AzureTranslateToolSpec,
)
__all__ = ["AzureTranslateToolSpec", "ENDPOINT_BASE_URL"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/base.py | llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/base.py | """Azure Translate tool spec."""
import requests
from llama_index.core.tools.tool_spec.base import BaseToolSpec
ENDPOINT_BASE_URL = "https://api.cognitive.microsofttranslator.com/translate"
class AzureTranslateToolSpec(BaseToolSpec):
"""Azure Translate tool spec."""
spec_functions = ["translate"]
def ... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-salesforce/tests/test_tools_salesforce.py | llama-index-integrations/tools/llama-index-tools-salesforce/tests/test_tools_salesforce.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.salesforce import SalesforceToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in SalesforceToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-salesforce/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-salesforce/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/__init__.py | llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/__init__.py | from llama_index.tools.salesforce.base import SalesforceToolSpec
__all__ = ["SalesforceToolSpec"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/base.py | llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/base.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
class SalesforceToolSpec(BaseToolSpec):
"""
Salesforce tool spec.
Gives the agent the ability to interact with Salesforce using simple_salesforce
"""
spec_functions = ["execute_sosl", "execute_soql"]
def __init__(self, **kargs)... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/test_tools_chatgpt_plugin.py | llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/test_tools_chatgpt_plugin.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.chatgpt_plugin import ChatGPTPluginToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in ChatGPTPluginToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/__init__.py | llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/__init__.py | """init.py."""
from llama_index.tools.chatgpt_plugin.base import (
ChatGPTPluginToolSpec,
)
__all__ = ["ChatGPTPluginToolSpec"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/base.py | llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/base.py | """ChatGPT Plugiun Tool."""
from typing import List, Optional
import requests
from llama_index.core.schema import Document
from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.openapi.base import OpenAPIToolSpec
class ChatGPTPluginToolSpec(BaseToolSpec):
"""
ChatGPT Plugin T... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/tests/schemas.py | llama-index-integrations/tools/llama-index-tools-mcp/tests/schemas.py | from typing import Literal, List
from pydantic import BaseModel
MethodType = Literal["POST", "GET", "UPDATE", "DELETE"]
XY = List[str]
class TestName(BaseModel):
name: str
class TestMethod(BaseModel):
method: MethodType
class TestList(BaseModel):
lst: List[int]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-mcp/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/tests/test_tools_mcp.py | llama-index-integrations/tools/llama-index-tools-mcp/tests/test_tools_mcp.py | import os
import pytest
from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
# Path to the test server script - adjust as needed
SERVER_SCRIPT = os.path.join(os.path.dirname(__file__), "server.py")
@pytest.fixture(scope="session")
def client() ... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/tests/server.py | llama-index-integrations/tools/llama-index-tools-mcp/tests/server.py | import asyncio
import random
import time
from contextlib import asynccontextmanager
from collections.abc import AsyncIterator
from datetime import datetime
from typing import Dict, Optional
from mcp.server.fastmcp import FastMCP, Context, Image
from mcp.server.fastmcp.prompts import base
from PIL import Image as PILIm... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/tests/test_client.py | llama-index-integrations/tools/llama-index-tools-mcp/tests/test_client.py | import os
from httpx import AsyncClient
import pytest
from llama_index.tools.mcp import BasicMCPClient
from llama_index.tools.mcp.client import enable_sse
from mcp import types
# Path to the test server script - adjust as needed
SERVER_SCRIPT = os.path.join(os.path.dirname(__file__), "server.py")
@pytest.fixture(s... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/examples/mcp_server.py | llama-index-integrations/tools/llama-index-tools-mcp/examples/mcp_server.py | import argparse
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, IPvAnyAddress
import ipinfo
import os
import dotenv
dotenv.load_dotenv()
# Create MCP server
mcp = FastMCP("BasicServer")
class IPDetails(BaseModel):
ip: IPvAnyAddress = None # type: ignore
hostname: str | None = None
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/client.py | llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/client.py | import warnings
import logging
import io
from contextlib import asynccontextmanager
from datetime import timedelta
from typing import (
Optional,
List,
Dict,
Tuple,
Callable,
AsyncIterator,
Awaitable,
Any,
)
from urllib.parse import urlparse, parse_qs
from httpx import AsyncClient, Time... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/tool_spec_mixins.py | llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/tool_spec_mixins.py | from typing import Any, Dict, List, Union, Literal, Type, TYPE_CHECKING
from pydantic import Field
if TYPE_CHECKING:
from llama_index.tools.mcp.base import McpToolSpec
# Map JSON Schema types to Python types
json_type_mapping: Dict[str, Type] = {
"string": str,
"number": float,
"integer": int,
"bo... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/utils.py | llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/utils.py | from typing import Any, List, Optional
from mcp.client.session import ClientSession
from mcp.server.fastmcp import FastMCP, Context
from pydantic import BaseModel
from llama_index.core.tools import FunctionTool
from llama_index.core.workflow import Event, StartEvent, StopEvent, Workflow
from llama_index.tools.mcp.bas... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/__init__.py | llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/__init__.py | from llama_index.tools.mcp.base import McpToolSpec
from llama_index.tools.mcp.client import BasicMCPClient
from llama_index.tools.mcp.utils import (
workflow_as_mcp,
get_tools_from_mcp_url,
aget_tools_from_mcp_url,
)
__all__ = [
"McpToolSpec",
"BasicMCPClient",
"workflow_as_mcp",
"get_tools... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/base.py | llama-index-integrations/tools/llama-index-tools-mcp/llama_index/tools/mcp/base.py | import asyncio
import logging
from typing import Any, Callable, List, Optional
from mcp.client.session import ClientSession
from mcp.types import Resource
from pydantic import BaseModel, create_model
from llama_index.core.tools.function_tool import FunctionTool
from llama_index.core.tools.tool_spec.base import BaseTo... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-database/tests/test_tools_database.py | llama-index-integrations/tools/llama-index-tools-database/tests/test_tools_database.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.database import DatabaseToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in DatabaseToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-database/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-database/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-database/llama_index/tools/database/__init__.py | llama-index-integrations/tools/llama-index-tools-database/llama_index/tools/database/__init__.py | # __init__.py
from llama_index.tools.database.base import (
DatabaseToolSpec,
)
__all__ = ["DatabaseToolSpec"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-database/llama_index/tools/database/base.py | llama-index-integrations/tools/llama-index-tools-database/llama_index/tools/database/base.py | """Database Tool."""
from typing import Any, List, Optional
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.core.utilities.sql_wrapper import SQLDatabase
from sqlalchemy import MetaData, t... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-playgrounds/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/tests/test_tools_playgrounds.py | llama-index-integrations/tools/llama-index-tools-playgrounds/tests/test_tools_playgrounds.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.playgrounds import (
PlaygroundsSubgraphConnectorToolSpec,
PlaygroundsSubgraphInspectorToolSpec,
)
def test_class():
names_of_base_classes = [
b.__name__ for b in PlaygroundsSubgraphConnectorToolSpec.__mro__
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/__init__.py | llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/__init__.py | from llama_index.tools.playgrounds.subgraph_connector.base import (
PlaygroundsSubgraphConnectorToolSpec,
)
from llama_index.tools.playgrounds.subgraph_inspector.base import (
PlaygroundsSubgraphInspectorToolSpec,
)
__all__ = [
"PlaygroundsSubgraphConnectorToolSpec",
"PlaygroundsSubgraphInspectorToolSp... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/__init__.py | llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/base.py | llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/base.py | """PlaygroundsSubgraphConnectorToolSpec."""
from typing import Optional, Union
import requests
from llama_index.tools.graphql.base import GraphQLToolSpec
class PlaygroundsSubgraphConnectorToolSpec(GraphQLToolSpec):
"""
Connects to subgraphs on The Graph's decentralized network via the Playgrounds API.
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_inspector/__init__.py | llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_inspector/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_inspector/base.py | llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_inspector/base.py | """PlaygroundsSubgraphInspectorToolSpec."""
import requests
from llama_index.tools.graphql.base import GraphQLToolSpec
class PlaygroundsSubgraphInspectorToolSpec(GraphQLToolSpec):
"""
Connects to subgraphs on The Graph's decentralized network via the Playgrounds API and introspects the subgraph.
Provides... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-metaphor/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-metaphor/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-metaphor/tests/test_tools_metaphor.py | llama-index-integrations/tools/llama-index-tools-metaphor/tests/test_tools_metaphor.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.metaphor import MetaphorToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in MetaphorToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-metaphor/llama_index/tools/metaphor/__init__.py | llama-index-integrations/tools/llama-index-tools-metaphor/llama_index/tools/metaphor/__init__.py | from llama_index.tools.metaphor.base import MetaphorToolSpec
__all__ = ["MetaphorToolSpec"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-metaphor/llama_index/tools/metaphor/base.py | llama-index-integrations/tools/llama-index-tools-metaphor/llama_index/tools/metaphor/base.py | """Metaphor tool spec."""
import datetime
from typing import List, Optional
from llama_index.core.schema import Document
from llama_index.core.tools.tool_spec.base import BaseToolSpec
class MetaphorToolSpec(BaseToolSpec):
"""Metaphor tool spec."""
spec_functions = [
"search",
"retrieve_docu... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-elevenlabs/tests/test_tools_elevenlabs.py | llama-index-integrations/tools/llama-index-tools-elevenlabs/tests/test_tools_elevenlabs.py | from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.elevenlabs import ElevenLabsToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in ElevenLabsToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-elevenlabs/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-elevenlabs/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-elevenlabs/llama_index/tools/elevenlabs/__init__.py | llama-index-integrations/tools/llama-index-tools-elevenlabs/llama_index/tools/elevenlabs/__init__.py | ## init file
from llama_index.tools.elevenlabs.base import (
ElevenLabsToolSpec,
)
__all__ = ["ElevenLabsToolSpec"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-elevenlabs/llama_index/tools/elevenlabs/base.py | llama-index-integrations/tools/llama-index-tools-elevenlabs/llama_index/tools/elevenlabs/base.py | """ElevenLabs text to speech tool spec."""
from typing import List, Optional
from llama_index.core.tools.tool_spec.base import BaseToolSpec
class ElevenLabsToolSpec(BaseToolSpec):
"""ElevenLabs tool spec for text-to-speech synthesis."""
spec_functions = ["get_voices", "text_to_speech"]
def __init__(
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-notion/tests/__init__.py | llama-index-integrations/tools/llama-index-tools-notion/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-notion/tests/test_tools_notion.py | llama-index-integrations/tools/llama-index-tools-notion/tests/test_tools_notion.py | import os
import pytest
from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.notion import NotionToolSpec
# Get yourself a page id and database id from your notion account
# Refer to the page: https://developers.notion.com/docs/create-a-notion-integration#give-your-integration-page-pe... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-notion/llama_index/tools/notion/__init__.py | llama-index-integrations/tools/llama-index-tools-notion/llama_index/tools/notion/__init__.py | """Notion tool spec."""
from llama_index.tools.notion.base import (
NotionToolSpec,
)
__all__ = [
"NotionToolSpec",
]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/tools/llama-index-tools-notion/llama_index/tools/notion/base.py | llama-index-integrations/tools/llama-index-tools-notion/llama_index/tools/notion/base.py | """Notion tool spec."""
from typing import Any, Dict, List, Optional, Type
import requests
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.tools.tool_spec.base import SPEC_FUNCTION_TYPE, BaseToolSpec
from llama_index.readers.notion import NotionPageReader
SEARCH_URL = "https://api.notion... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/conftest.py | llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/conftest.py | # pants requires this import to recognize the dep
import pytest_asyncio # noqa: F401
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/test_sparse_embeddings_fastembed.py | llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/test_sparse_embeddings_fastembed.py | import pytest
from llama_index.core.base.embeddings.base_sparse import BaseSparseEmbedding
from llama_index.sparse_embeddings.fastembed import FastEmbedSparseEmbedding
def test_class():
names_of_base_classes = [b.__name__ for b in FastEmbedSparseEmbedding.__mro__]
assert BaseSparseEmbedding.__name__ in names... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/__init__.py | llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/llama_index/sparse_embeddings/fastembed/__init__.py | llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/llama_index/sparse_embeddings/fastembed/__init__.py | from llama_index.sparse_embeddings.fastembed.base import FastEmbedSparseEmbedding
__all__ = ["FastEmbedSparseEmbedding"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/llama_index/sparse_embeddings/fastembed/base.py | llama-index-integrations/sparse_embeddings/llama-index-sparse-embeddings-fastembed/llama_index/sparse_embeddings/fastembed/base.py | from typing import Any, List, Optional
from llama_index.core.base.embeddings.base_sparse import (
BaseSparseEmbedding,
SparseEmbedding,
)
from llama_index.core.bridge.pydantic import Field, PrivateAttr
from fastembed import SparseTextEmbedding
from fastembed.sparse.sparse_embedding_base import (
SparseEmb... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/tests/test_utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/tests/test_utils.py | import pytest
from llama_index.voice_agents.gemini_live.utils import (
tools_to_gemini_tools,
tool_to_fn,
tools_to_functions_dict,
)
from llama_index.core.tools import FunctionTool
from typing import List, Dict, Any
from google.genai import types
def get_weather(location: str) -> str:
"""Get the weat... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/tests/test_audio_interface.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/tests/test_audio_interface.py | import pytest
import asyncio
from llama_index.core.voice_agents.interface import BaseVoiceAgentInterface
from llama_index.voice_agents.gemini_live.audio_interface import (
GeminiLiveVoiceAgentInterface,
)
from google.genai.live import AsyncSession
from typing_extensions import override
class MockSession(AsyncSes... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/events.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/events.py | from llama_index.core.voice_agents import BaseVoiceAgentEvent
from typing import Dict, Any
class AudioSentEvent(BaseVoiceAgentEvent):
data: bytes
class AudioReceivedEvent(BaseVoiceAgentEvent):
data: bytes
class TextSentEvent(BaseVoiceAgentEvent):
text: str
class TextReceivedEvent(BaseVoiceAgentEvent... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/utils.py | from llama_index.core.tools import BaseTool
from typing import Dict, List, Callable, Any
from google.genai import types
def tool_to_fn(
tool: BaseTool,
) -> Callable[[Dict[str, Any], str, str], types.FunctionResponse]:
def fn(args: Dict[str, Any], id_: str, name: str) -> types.FunctionResponse:
return... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/__init__.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/__init__.py | from .base import GeminiLiveVoiceAgent
from .audio_interface import GeminiLiveVoiceAgentInterface
__all__ = ["GeminiLiveVoiceAgent", "GeminiLiveVoiceAgentInterface"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/base.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/base.py | import asyncio
import logging
from typing import Optional, Any, List, Dict, Callable
from typing_extensions import override
from .audio_interface import GeminiLiveVoiceAgentInterface
from .utils import tools_to_gemini_tools, tools_to_functions_dict
from .events import (
TextReceivedEvent,
AudioReceivedEvent,
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/audio_interface.py | llama-index-integrations/voice_agents/llama-index-voice-agents-gemini-live/llama_index/voice_agents/gemini_live/audio_interface.py | import pyaudio
import asyncio
from typing import Any, Optional
from typing_extensions import override
from google.genai.live import AsyncSession
from llama_index.core.voice_agents import BaseVoiceAgentInterface
FORMAT = pyaudio.paInt16
CHANNELS = 1
SEND_SAMPLE_RATE = 16000
RECEIVE_SAMPLE_RATE = 24000
CHUNK_SIZE = 10... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/test_utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/test_utils.py | import pytest
from llama_index.voice_agents.openai.utils import get_tool_by_name
from llama_index.core.tools import FunctionTool
from typing import List
@pytest.fixture()
def function_tools() -> List[FunctionTool]:
def add(i: int, j: int) -> int:
return i + j
def greet(name: str) -> str:
ret... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/__init__.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/test_serialization.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/tests/test_serialization.py | import pytest
from llama_index.voice_agents.openai.types import (
ConversationDeltaEvent,
ConversationDoneEvent,
ConversationSession,
ConversationSessionUpdate,
)
@pytest.fixture()
def session_json() -> dict:
return {
"modalities": ["text", "audio"],
"instructions": "You are a hel... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/websocket.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/websocket.py | import threading
import json
import logging
import asyncio
import websockets
from websockets import ConnectionClosedError
from typing import Optional, Callable, Any
from llama_index.core.voice_agents import BaseVoiceAgentWebsocket
logging.basicConfig(
level=logging.INFO, format="%(asctime)s [%(levelname)s] %(mess... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/utils.py | from llama_index.core.tools import BaseTool
from typing import List, Union
def get_tool_by_name(tools: List[BaseTool], name: str) -> Union[BaseTool, None]:
for tool in tools:
if tool.metadata.get_name() == name:
return tool
return None
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/__init__.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/__init__.py | from llama_index.voice_agents.openai.base import OpenAIVoiceAgent
from llama_index.voice_agents.openai.websocket import OpenAIVoiceAgentWebsocket
from llama_index.voice_agents.openai.audio_interface import OpenAIVoiceAgentInterface
__all__ = ["OpenAIVoiceAgent", "OpenAIVoiceAgentWebsocket", "OpenAIVoiceAgentInterface"... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/types.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/types.py | import base64
import binascii
import json
from typing import Union, List, Dict, Literal, Optional, Any
from typing_extensions import Self
from llama_index.core.voice_agents import BaseVoiceAgentEvent
from llama_index.core.bridge.pydantic import BaseModel, Field, model_validator
class ConversationVAD(BaseModel):
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/base.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/base.py | import base64
import logging
import os
import threading
from typing import List, Optional, Dict, Any
from .types import (
ConversationInputEvent,
ConversationDeltaEvent,
ConversationDoneEvent,
ConversationSessionUpdate,
ConversationSession,
ConversationTool,
ToolParameters,
FunctionCall... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/audio_interface.py | llama-index-integrations/voice_agents/llama-index-voice-agents-openai/llama_index/voice_agents/openai/audio_interface.py | import pyaudio
import queue
import time
import logging
import threading
import asyncio
from typing import Callable, Optional, Any, Tuple, Union
from llama_index.core.voice_agents import BaseVoiceAgentInterface
logging.basicConfig(
level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s"
)
CHUNK_SIZE ... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/test_utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/test_utils.py | import pytest
from typing import Dict, List
from llama_index.core.llms import ChatMessage, MessageRole, TextBlock, AudioBlock
from llama_index.voice_agents.elevenlabs.utils import (
callback_agent_message,
callback_agent_message_correction,
callback_latency_measurement,
callback_user_message,
get_m... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/__init__.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/test_events.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/tests/test_events.py | from llama_index.voice_agents.elevenlabs.events import (
PingEvent,
AudioEvent,
AgentResponseEvent,
AgentResponseCorrectionEvent,
UserTranscriptionEvent,
InterruptionEvent,
ConversationInitEvent,
ClientToolCallEvent,
)
from llama_index.core.voice_agents import BaseVoiceAgentEvent
def t... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/events.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/events.py | from llama_index.core.voice_agents import BaseVoiceAgentEvent
from llama_index.core.bridge.pydantic import ConfigDict
from typing import Union, Any
class ConversationInitEvent(BaseVoiceAgentEvent):
model_config = ConfigDict(extra="allow")
conversation_id: str
class AudioEvent(BaseVoiceAgentEvent):
mode... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/interface.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/interface.py | from llama_index.core.voice_agents.interface import BaseVoiceAgentInterface
from elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterface
class ElevenLabsVoiceAgentInterface(DefaultAudioInterface, BaseVoiceAgentInterface):
def __init__(self, *args, **kwargs):
super().__init__()
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/utils.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/utils.py | from pydantic import BaseModel
from inspect import Signature, Parameter
from typing import Any, Dict, Optional, List, Callable
from llama_index.core.llms import ChatMessage, AudioBlock, TextBlock, MessageRole
from llama_index.core.tools import BaseTool
def make_function_from_tool_model(
model_cls: type[BaseModel... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/__init__.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/__init__.py | from .base import ElevenLabsVoiceAgent, ElevenLabsVoiceAgentInterface
__all__ = ["ElevenLabsVoiceAgent", "ElevenLabsVoiceAgentInterface"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/base.py | llama-index-integrations/voice_agents/llama-index-voice-agents-elevenlabs/llama_index/voice_agents/elevenlabs/base.py | import base64
import json
import threading
import warnings
from llama_index.core.voice_agents import (
BaseVoiceAgent,
BaseVoiceAgentInterface,
BaseVoiceAgentEvent,
)
from statistics import mean
from websockets.sync.client import Connection
from typing import Optional, Callable, Dict, List, Any, Union
from... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/tests/test_program_evaporate.py | llama-index-integrations/program/llama-index-program-evaporate/tests/test_program_evaporate.py | from llama_index.core.program import BasePydanticProgram
from llama_index.program.evaporate import DFEvaporateProgram
def test_class():
names_of_base_classes = [b.__name__ for b in DFEvaporateProgram.__mro__]
assert BasePydanticProgram.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/tests/__init__.py | llama-index-integrations/program/llama-index-program-evaporate/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/prompts.py | llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/prompts.py | """
Prompts from evaporate repo.
Full credits go to: https://github.com/HazyResearch/evaporate
"""
from llama_index.core.prompts import PromptTemplate
# deprecated, kept for backward compatibility
"""Pandas PromptTemplate. Convert query to python code.
Required template variables: `chunk`, `topic`.
Args:
t... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/extractor.py | llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/extractor.py | import random
import re
import signal
from collections import defaultdict
from contextlib import contextmanager
from typing import Any, Dict, List, Optional, Set, Tuple
from llama_index.core.llms.llm import LLM
from llama_index.core.schema import BaseNode, MetadataMode, NodeWithScore, QueryBundle
from llama_index.core... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/df.py | llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/df.py | from typing import Any, List, Optional, Type, cast
import pandas as pd
from llama_index.core.bridge.pydantic import BaseModel, Field
from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram
from llama_index.core.types import BasePydanticProgram
from llama_index.core.program.function_program impor... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/__init__.py | llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/__init__.py | from llama_index.program.evaporate.base import BaseEvaporateProgram, DFEvaporateProgram
__all__ = ["BaseEvaporateProgram", "DFEvaporateProgram"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/base.py | llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/base.py | import logging
from abc import abstractmethod
from typing import Any, Dict, Generic, List, Optional, Type
import pandas as pd
from llama_index.core.llms import LLM
from llama_index.core.schema import BaseNode, TextNode
from llama_index.core.types import BasePydanticProgram, Model
from llama_index.core.utils import pri... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-guidance/tests/test_program_guidance.py | llama-index-integrations/program/llama-index-program-guidance/tests/test_program_guidance.py | from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram
from llama_index.program.guidance import GuidancePydanticProgram
def test_class():
names_of_base_classes = [b.__name__ for b in GuidancePydanticProgram.__mro__]
assert BaseLLMFunctionProgram.__name__ in names_of_base_classes
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-guidance/tests/__init__.py | llama-index-integrations/program/llama-index-program-guidance/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/utils.py | llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/utils.py | from typing import Optional, Type, TypeVar
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.output_parsers.base import OutputParserException
from llama_index.core.output_parsers.utils import parse_json_markdown
def convert_to_handlebars(text: str) -> str:
"""
Convert a python form... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/__init__.py | llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/__init__.py | from llama_index.program.guidance.base import GuidancePydanticProgram
__all__ = ["GuidancePydanticProgram"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/base.py | llama-index-integrations/program/llama-index-program-guidance/llama_index/program/guidance/base.py | from functools import partial
from typing import Any, Optional, Type, cast
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram
from llama_index.core.prompts.base import PromptTemplate
from llama_index.program.guidance.utils import (
... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/test_program_lmformatenforcer.py | llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/test_program_lmformatenforcer.py | from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram
from llama_index.program.lmformatenforcer import LMFormatEnforcerPydanticProgram
def test_class():
names_of_base_classes = [
b.__name__ for b in LMFormatEnforcerPydanticProgram.__mro__
]
assert BaseLLMFunctionProgram.__... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/__init__.py | llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/utils.py | llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/utils.py | from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, Iterator
from llama_index.core.llms.llm import LLM
from llama_index.llms.huggingface import HuggingFaceLLM
from llama_index.llms.llama_cpp import LlamaCPP
if TYPE_CHECKING:
from lmformatenforcer import CharacterLevelParser
def bui... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/__init__.py | llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/__init__.py | from llama_index.program.lmformatenforcer.base import LMFormatEnforcerPydanticProgram
__all__ = ["LMFormatEnforcerPydanticProgram"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/base.py | llama-index-integrations/program/llama-index-program-lmformatenforcer/llama_index/program/lmformatenforcer/base.py | import json
from typing import Any, Dict, Optional, Type, Union, cast
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.program.llm_prompt_program import BaseLLMFunctionProgram
from llama_index.core.prompts.base import PromptTemplate
from llama_index.llms.huggingface import HuggingFaceLLM
fr... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/tests/test_indices_managed_llama_cloud.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/tests/test_indices_managed_llama_cloud.py | import os
import pytest
import tempfile
from typing import Generator, Tuple
from uuid import uuid4
from llama_cloud import (
AutoTransformConfig,
PipelineCreate,
PipelineFileCreate,
ProjectCreate,
CompositeRetrievalMode,
LlamaParseParameters,
ReRankConfig,
)
from llama_cloud.client import L... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/tests/__init__.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/composite_retriever.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/composite_retriever.py | from typing import Any, List, Optional
from deprecated import deprecated
import httpx
from llama_cloud import (
CompositeRetrievalMode,
CompositeRetrievedTextNodeWithScore,
RetrieverCreate,
Retriever,
RetrieverPipeline,
PresetRetrievalParams,
ReRankConfig,
)
from llama_cloud.resources.pipel... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/__init__.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/__init__.py | from llama_index.indices.managed.llama_cloud.base import LlamaCloudIndex
from llama_index.indices.managed.llama_cloud.retriever import LlamaCloudRetriever
from llama_index.indices.managed.llama_cloud.composite_retriever import (
LlamaCloudCompositeRetriever,
)
__all__ = [
"LlamaCloudIndex",
"LlamaCloudRetr... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/retriever.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/retriever.py | from typing import Any, List, Optional
from deprecated import deprecated
import httpx
from llama_cloud import (
TextNodeWithScore,
)
from llama_cloud.resources.pipelines.client import OMIT
from llama_index.core.base.base_retriever import BaseRetriever
from llama_index.core.bridge.pydantic import BaseModel
from ll... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/base.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/base.py | """
Managed index.
A managed Index - where the index is accessible via some API that
interfaces a managed service.
"""
import asyncio
from deprecated import deprecated
import httpx
import os
import time
from typing import Any, Awaitable, Callable, List, Optional, Sequence, Type
from urllib.parse import quote_plus
f... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | true |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/api_utils.py | llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/api_utils.py | import base64
import urllib.parse
import uuid
from httpx import Request, HTTPStatusError
from tenacity import (
retry,
wait_exponential_jitter,
stop_after_attempt,
retry_if_exception,
)
from typing import Any, Optional, Tuple, List, Union, Dict, Callable
from llama_index.core.async_utils import run_job... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/indices/llama-index-indices-managed-colbert/tests/__init__.py | llama-index-integrations/indices/llama-index-indices-managed-colbert/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.