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/llms/llama-index-llms-langchain/llama_index/llms/langchain/utils.py
llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/utils.py
from typing import List, Sequence from llama_index.core.base.llms.types import ChatMessage, LLMMetadata, MessageRole from llama_index.core.constants import AI21_J2_CONTEXT_WINDOW, COHERE_CONTEXT_WINDOW class LC: from llama_index.core.bridge.langchain import ( AI21, AIMessage, BaseChatMode...
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/llms/llama-index-llms-langchain/llama_index/llms/langchain/__init__.py
llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/__init__.py
from llama_index.llms.langchain.base import LangChainLLM __all__ = ["LangChainLLM"]
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/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py
llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py
from typing import Any, Callable, Generator, Optional, Sequence from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, ) from llama_index.core.br...
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/llms/llama-index-llms-google-genai/tests/test_llms_google_genai.py
llama-index-integrations/llms/llama-index-llms-google-genai/tests/test_llms_google_genai.py
import os from typing import List, Optional from unittest.mock import MagicMock, patch import pytest from google.genai import types from llama_index.core.base.llms.types import ( ChatMessage, ImageBlock, MessageRole, TextBlock, VideoBlock, ThinkingBlock, ToolCallBlock, ) from llama_index.co...
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/llms/llama-index-llms-google-genai/tests/test_llms_google_genai_vertex.py
llama-index-integrations/llms/llama-index-llms-google-genai/tests/test_llms_google_genai_vertex.py
from datetime import datetime from enum import Enum import os from typing import List, Optional, Union from unittest.mock import MagicMock import pytest from llama_index.core.program.function_program import get_function_tool from pydantic import BaseModel, Field from google.genai import types from llama_index.llms.go...
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/llms/llama-index-llms-google-genai/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-google-genai/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/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/utils.py
llama-index-integrations/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/utils.py
import asyncio import json import logging from collections.abc import Sequence from io import IOBase from typing import ( TYPE_CHECKING, Any, Dict, Union, Optional, Type, Tuple, List, Literal, cast, ) import typing import google.genai.types as types import google.genai import ht...
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/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/__init__.py
llama-index-integrations/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/__init__.py
from llama_index.llms.google_genai.base import GoogleGenAI __all__ = ["GoogleGenAI"]
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/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/base.py
llama-index-integrations/llms/llama-index-llms-google-genai/llama_index/llms/google_genai/base.py
"""Google's hosted Gemini API.""" import asyncio import functools import os import typing from typing import ( TYPE_CHECKING, cast, Any, AsyncGenerator, Dict, Generator, List, Optional, Sequence, Type, Union, Callable, Literal, ) import llama_index.core.instrumenta...
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/llms/llama-index-llms-sarvam/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-sarvam/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/llms/llama-index-llms-sarvam/tests/test_llms_servam.py
llama-index-integrations/llms/llama-index-llms-sarvam/tests/test_llms_servam.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.sarvam import Sarvam def test_llm_class(): names_of_base_classes = [b.__name__ for b in Sarvam.__mro__] assert BaseLLM.__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/llms/llama-index-llms-sarvam/llama_index/llms/sarvam/__init__.py
llama-index-integrations/llms/llama-index-llms-sarvam/llama_index/llms/sarvam/__init__.py
from llama_index.llms.sarvam.base import Sarvam __all__ = ["Sarvam"]
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/llms/llama-index-llms-sarvam/llama_index/llms/sarvam/base.py
llama-index-integrations/llms/llama-index-llms-sarvam/llama_index/llms/sarvam/base.py
from typing import Any, Dict, Optional from llama_index.core.base.llms.types import LLMMetadata from llama_index.core.bridge.pydantic import Field from llama_index.core.constants import ( DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) from llama_index.core.base.llms.generic_utils 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/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.nvidia_tensorrt import LocalTensorRTLLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in LocalTensorRTLLM.__mro__] assert BaseLLM.__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/llms/llama-index-llms-nvidia-tensorrt/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/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/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/utils.py
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/utils.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
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/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/__init__.py
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/__init__.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
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/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
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/llms/llama-index-llms-opea/tests/test_llms_opea.py
llama-index-integrations/llms/llama-index-llms-opea/tests/test_llms_opea.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.opea import OPEA def test_embedding_class(): names_of_base_classes = [b.__name__ for b in OPEA.__mro__] assert BaseLLM.__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/llms/llama-index-llms-opea/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-opea/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/llms/llama-index-llms-opea/llama_index/llms/opea/__init__.py
llama-index-integrations/llms/llama-index-llms-opea/llama_index/llms/opea/__init__.py
from llama_index.llms.opea.base import OPEA __all__ = ["OPEA"]
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/llms/llama-index-llms-opea/llama_index/llms/opea/base.py
llama-index-integrations/llms/llama-index-llms-opea/llama_index/llms/opea/base.py
from llama_index.core.base.llms.types import ( LLMMetadata, ) from llama_index.core.bridge.pydantic import Field from llama_index.llms.openai_like.base import OpenAILike class OPEA(OpenAILike): """ Adapter for a OPEA LLM. Examples: `pip install llama-index-llms-opea` ```python ...
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/llms/llama-index-llms-upstage/tests/test_upstage.py
llama-index-integrations/llms/llama-index-llms-upstage/tests/test_upstage.py
import os from typing import Any, Generator, AsyncGenerator from unittest.mock import MagicMock, patch, AsyncMock import pytest from llama_index.core.llms import ChatMessage from openai.types.chat.chat_completion import ChatCompletion, Choice from openai.types.chat.chat_completion_chunk import ( ChatCompletionChun...
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/llms/llama-index-llms-upstage/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-upstage/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/llms/llama-index-llms-upstage/tests/test_llms_upstage.py
llama-index-integrations/llms/llama-index-llms-upstage/tests/test_llms_upstage.py
import pytest from llama_index.core.base.llms.base import BaseLLM from llama_index.core.base.llms.types import ChatMessage, MessageRole from llama_index.llms.upstage import Upstage def test_text_inference_llm_class(): names_of_base_classes = [b.__name__ for b in Upstage.__mro__] assert BaseLLM.__name__ in nam...
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/llms/llama-index-llms-upstage/llama_index/llms/upstage/utils.py
llama-index-integrations/llms/llama-index-llms-upstage/llama_index/llms/upstage/utils.py
import logging from typing import Any, Dict, Optional, Tuple from llama_index.core.base.llms.generic_utils import get_from_param_or_env DEFAULT_UPSTAGE_API_BASE = "https://api.upstage.ai/v1/solar" DEFAULT_CONTEXT_WINDOW = 32768 CHAT_MODELS = {"solar-mini": 32768, "solar-pro2": 65536} FUNCTION_CALLING_MODELS = ["sola...
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/llms/llama-index-llms-upstage/llama_index/llms/upstage/__init__.py
llama-index-integrations/llms/llama-index-llms-upstage/llama_index/llms/upstage/__init__.py
from llama_index.llms.upstage.base import Upstage __all__ = ["Upstage"]
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/llms/llama-index-llms-upstage/llama_index/llms/upstage/base.py
llama-index-integrations/llms/llama-index-llms-upstage/llama_index/llms/upstage/base.py
import os from pathlib import Path from typing import List, Optional, Dict, Any, Sequence, Callable, Union, Literal import warnings import httpx from llama_index.readers.upstage import UpstageDocumentParseReader from llama_index.llms.openai.utils import ( create_retry_decorator, ) from llama_index.core.base.llms.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/llms/llama-index-llms-vercel-ai-gateway/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-vercel-ai-gateway/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/llms/llama-index-llms-vercel-ai-gateway/tests/test_vercel_ai_gateway.py
llama-index-integrations/llms/llama-index-llms-vercel-ai-gateway/tests/test_vercel_ai_gateway.py
import inspect import os from collections.abc import AsyncGenerator, AsyncIterator from unittest.mock import AsyncMock, patch import pytest from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, MessageRole, ) from llama_index.llms.vercel_ai_gateway import Vercel...
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/llms/llama-index-llms-vercel-ai-gateway/llama_index/llms/vercel_ai_gateway/__init__.py
llama-index-integrations/llms/llama-index-llms-vercel-ai-gateway/llama_index/llms/vercel_ai_gateway/__init__.py
from llama_index.llms.vercel_ai_gateway.base import VercelAIGateway __all__ = ["VercelAIGateway"]
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/llms/llama-index-llms-vercel-ai-gateway/llama_index/llms/vercel_ai_gateway/base.py
llama-index-integrations/llms/llama-index-llms-vercel-ai-gateway/llama_index/llms/vercel_ai_gateway/base.py
from typing import Any, Dict, Optional from llama_index.core.base.llms.types import LLMMetadata from llama_index.core.bridge.pydantic import Field from llama_index.core.constants import ( DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) from llama_index.core.base.llms.generic_utils 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/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py
llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.bedrock import Bedrock def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Bedrock.__mro__] assert BaseLLM.__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/llms/llama-index-llms-bedrock/tests/test_utils.py
llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_utils.py
import pytest from llama_index.llms.bedrock.utils import ( get_provider, MetaProvider, MistralProvider, AmazonProvider, AnthropicProvider, CohereProvider, Ai21Provider, ) @pytest.mark.parametrize( ("model", "provider_cls"), [ ("meta.llama3-3-70b-instruct-v1:0", MetaProvide...
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/llms/llama-index-llms-bedrock/tests/test_bedrock.py
llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_bedrock.py
import json from io import BytesIO from typing import Any, Generator import pytest from botocore.response import StreamingBody from botocore.stub import Stubber from llama_index.core.base.llms.types import ChatMessage from llama_index.llms.bedrock import Bedrock, ProviderType from pytest import MonkeyPatch class Moc...
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/llms/llama-index-llms-bedrock/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-bedrock/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/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/llama_utils.py
llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/llama_utils.py
from typing import List, Optional, Sequence from llama_index.core.base.llms.types import ChatMessage, MessageRole BOS, EOS = "<s>", "</s>" B_INST, E_INST = "[INST]", "[/INST]" B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n" DEFAULT_SYSTEM_PROMPT = """\ You are a helpful, respectful and honest assistant. \ Always answer ...
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/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py
llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py
import logging from enum import Enum from abc import ABC, abstractmethod from typing import Any, Callable, Dict, List, Optional, Sequence from llama_index.core.base.llms.types import ChatMessage from llama_index.core.base.llms.generic_utils import ( prompt_to_messages, ) from llama_index.llms.anthropic.utils 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/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/__init__.py
llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/__init__.py
from llama_index.llms.bedrock.base import ( Bedrock, completion_response_to_chat_response, completion_with_retry, ) from llama_index.llms.bedrock.utils import ProviderType __all__ = [ "Bedrock", "completion_with_retry", "completion_response_to_chat_response", "ProviderType", ]
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/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py
llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py
import json import deprecated from typing import Any, Callable, Dict, Optional, Sequence from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, )...
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/llms/llama-index-llms-keywordsai/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-keywordsai/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/llms/llama-index-llms-keywordsai/tests/test_llms_keywordsai.py
llama-index-integrations/llms/llama-index-llms-keywordsai/tests/test_llms_keywordsai.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.keywordsai import KeywordsAI def test_text_inference_embedding_class(): names_of_base_classes = [b.__name__ for b in KeywordsAI.__mro__] assert BaseLLM.__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/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/utils.py
llama-index-integrations/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/utils.py
import logging import os from typing import Any, Callable, Optional, Union, Tuple from functools import lru_cache from tenacity import ( before_sleep_log, retry, retry_if_exception_type, stop_after_attempt, stop_after_delay, wait_exponential, wait_random_exponential, ) from tenacity.stop im...
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/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/__init__.py
llama-index-integrations/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/__init__.py
from llama_index.llms.keywordsai.base import KeywordsAI __all__ = ["KeywordsAI"]
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/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/base.py
llama-index-integrations/llms/llama-index-llms-keywordsai/llama_index/llms/keywordsai/base.py
import functools from typing import ( Any, Callable, Dict, Optional, Sequence, ) import httpx from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, LLMMetadata, MessageRole, ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.c...
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/llms/llama-index-llms-you/tests/test_llms_you.py
llama-index-integrations/llms/llama-index-llms-you/tests/test_llms_you.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.you import You def test_llm_class(): names_of_base_classes = [b.__name__ for b in You.__mro__] assert BaseLLM.__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/llms/llama-index-llms-you/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-you/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/llms/llama-index-llms-you/llama_index/llms/you/__init__.py
llama-index-integrations/llms/llama-index-llms-you/llama_index/llms/you/__init__.py
from llama_index.llms.you.base import You __all__ = ["You"]
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/llms/llama-index-llms-you/llama_index/llms/you/base.py
llama-index-integrations/llms/llama-index-llms-you/llama_index/llms/you/base.py
import os from typing import Any, Dict, Generator, Literal, Optional import requests import sseclient from llama_index.core.llms import ( CompletionResponse, CompletionResponseGen, CustomLLM, LLMMetadata, ) from llama_index.core.llms.callbacks import llm_completion_callback from llama_index.core.bridge...
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/llms/llama-index-llms-mymagic/llama_index/llms/mymagic/__init__.py
llama-index-integrations/llms/llama-index-llms-mymagic/llama_index/llms/mymagic/__init__.py
from llama_index.llms.mymagic.base import MyMagicAI __all__ = ["MyMagicAI"]
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/llms/llama-index-llms-mymagic/llama_index/llms/mymagic/base.py
llama-index-integrations/llms/llama-index-llms-mymagic/llama_index/llms/mymagic/base.py
import time from typing import Any, Dict, List, Optional import httpx import asyncio import requests from llama_index.core.base.llms.types import ( CompletionResponse, CompletionResponseGen, ChatResponse, ChatResponseGen, ChatResponseAsyncGen, CompletionResponseAsyncGen, LLMMetadata, ) 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/llms/llama-index-llms-huggingface-api/tests/test_huggingface_api.py
llama-index-integrations/llms/llama-index-llms-huggingface-api/tests/test_huggingface_api.py
from unittest.mock import MagicMock, patch import pytest from llama_index.core.llms import ChatMessage, MessageRole from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI from huggingface_hub.inference._generated.types import ChatCompletionOutput STUB_MODEL_NAME = "Qwen/Qwen2.5-Coder-32B-Instruct" @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/llms/llama-index-llms-huggingface-api/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-huggingface-api/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/llms/llama-index-llms-huggingface-api/tests/test_llms_huggingface_api.py
llama-index-integrations/llms/llama-index-llms-huggingface-api/tests/test_llms_huggingface_api.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.core.tools import FunctionTool from unittest.mock import patch from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI def test_embedding_class(): names_of_base_classes = [b.__name__ for b in HuggingFaceInferenceAPI.__mro__] ass...
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/llms/llama-index-llms-huggingface-api/llama_index/llms/huggingface_api/__init__.py
llama-index-integrations/llms/llama-index-llms-huggingface-api/llama_index/llms/huggingface_api/__init__.py
from llama_index.llms.huggingface_api.base import ( HuggingFaceInferenceAPI, ) __all__ = ["HuggingFaceInferenceAPI"]
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/llms/llama-index-llms-huggingface-api/llama_index/llms/huggingface_api/base.py
llama-index-integrations/llms/llama-index-llms-huggingface-api/llama_index/llms/huggingface_api/base.py
import json import logging from huggingface_hub import AsyncInferenceClient, InferenceClient, model_info from huggingface_hub.hf_api import ModelInfo from huggingface_hub.inference._generated.types import ( ChatCompletionOutput, ChatCompletionStreamOutput, ChatCompletionOutputToolCall, ChatCompletionOut...
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/llms/llama-index-llms-palm/tests/test_llms_palm.py
llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.palm import PaLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in PaLM.__mro__] assert BaseLLM.__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/llms/llama-index-llms-palm/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-palm/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/llms/llama-index-llms-palm/llama_index/llms/palm/__init__.py
llama-index-integrations/llms/llama-index-llms-palm/llama_index/llms/palm/__init__.py
from llama_index.llms.palm.base import PaLM __all__ = ["PaLM"]
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/llms/llama-index-llms-palm/llama_index/llms/palm/base.py
llama-index-integrations/llms/llama-index-llms-palm/llama_index/llms/palm/base.py
"""Palm API.""" import os from typing import Any, Callable, Optional, Sequence import google.generativeai as palm from llama_index.core.base.llms.types import ( ChatMessage, CompletionResponse, CompletionResponseGen, LLMMetadata, ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from 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/llms/llama-index-llms-cleanlab/tests/test_llms_cleanlab.py
llama-index-integrations/llms/llama-index-llms-cleanlab/tests/test_llms_cleanlab.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.cleanlab import CleanlabTLM from llama_index.llms.cleanlab.base import DEFAULT_MODEL, DEFAULT_MAX_TOKENS def test_llms_cleanlab(): names_of_base_classes = [b.__name__ for b in CleanlabTLM.__mro__] assert BaseLLM.__name__ in names_of_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/llms/llama-index-llms-cleanlab/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-cleanlab/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/llms/llama-index-llms-cleanlab/llama_index/llms/cleanlab/__init__.py
llama-index-integrations/llms/llama-index-llms-cleanlab/llama_index/llms/cleanlab/__init__.py
from llama_index.llms.cleanlab.base import CleanlabTLM __all__ = ["CleanlabTLM"]
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/llms/llama-index-llms-cleanlab/llama_index/llms/cleanlab/base.py
llama-index-integrations/llms/llama-index-llms-cleanlab/llama_index/llms/cleanlab/base.py
from typing import Any, Dict, Optional # Import LlamaIndex dependencies from llama_index.core.base.llms.types import ( CompletionResponse, CompletionResponseGen, LLMMetadata, ) from llama_index.core.base.llms.generic_utils import ( get_from_param_or_env, ) from llama_index.core.llms.callbacks import 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/llms/llama-index-llms-sagemaker-endpoint/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/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/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py
llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.sagemaker_endpoint import SageMakerLLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in SageMakerLLM.__mro__] assert BaseLLM.__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/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/utils.py
llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/utils.py
import abc import codecs import json from typing import TYPE_CHECKING if TYPE_CHECKING: from botocore.response import StreamingBody from llama_index.core.bridge.pydantic import BaseModel, Field class BaseIOHandler(BaseModel, metaclass=abc.ABCMeta): content_type: str = Field( description="The MIME ty...
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/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/__init__.py
llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/__init__.py
from llama_index.llms.sagemaker_endpoint.base import SageMakerLLM __all__ = ["SageMakerLLM"]
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/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py
llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py
from typing import Any, Callable, Dict, Optional, Sequence from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, ) from llama_index.core.bridge....
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/llms/llama-index-llms-reka/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-reka/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/llms/llama-index-llms-reka/tests/test_reka.py
llama-index-integrations/llms/llama-index-llms-reka/tests/test_reka.py
import pytest import os import inspect from typing import AsyncIterator, Iterator from unittest import mock from llama_index.llms.reka import RekaLLM from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, MessageRole, ) @pytest.fixture() def reka_llm(): 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/llms/llama-index-llms-reka/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-reka/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/llms/llama-index-llms-reka/tests/test_llms_reka.py
llama-index-integrations/llms/llama-index-llms-reka/tests/test_llms_reka.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.reka import RekaLLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in RekaLLM.__mro__] assert BaseLLM.__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/llms/llama-index-llms-reka/llama_index/llms/reka/__init__.py
llama-index-integrations/llms/llama-index-llms-reka/llama_index/llms/reka/__init__.py
from llama_index.llms.reka.base import RekaLLM __all__ = ["RekaLLM"]
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/llms/llama-index-llms-reka/llama_index/llms/reka/base.py
llama-index-integrations/llms/llama-index-llms-reka/llama_index/llms/reka/base.py
import os from typing import Any, Dict, List, Optional, Sequence from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, MessageRole, ) from 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/llms/llama-index-llms-cortex/tests/test_llms_cortex.py
llama-index-integrations/llms/llama-index-llms-cortex/tests/test_llms_cortex.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.cortex import Cortex def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Cortex.__mro__] assert BaseLLM.__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/llms/llama-index-llms-cortex/tests/test_utils.py
llama-index-integrations/llms/llama-index-llms-cortex/tests/test_utils.py
from unittest.mock import mock_open, patch from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives import serialization from llama_index.llms.cortex.utils import ( generate_sf_jwt, is_spcs_environment, get_spcs_base_url, get_default_spcs_token, SPCS_TOKEN_PATH...
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/llms/llama-index-llms-cortex/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-cortex/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/llms/llama-index-llms-cortex/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-cortex/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/llms/llama-index-llms-cortex/tests/test_integration_cortex.py
llama-index-integrations/llms/llama-index-llms-cortex/tests/test_integration_cortex.py
import inspect import os from typing import AsyncIterator from unittest import mock from unittest.mock import AsyncMock, Mock, patch import pytest from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, MessageRole, ) from llama_index.llms.cortex import Cortex @p...
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/llms/llama-index-llms-cortex/llama_index/llms/cortex/utils.py
llama-index-integrations/llms/llama-index-llms-cortex/llama_index/llms/cortex/utils.py
import base64 import hashlib from datetime import datetime, timedelta, timezone import os import os import jwt from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( Encoding, PublicFormat, load_pem_private_key, ) SPCS_TOKEN_PATH = "/snowflake/se...
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/llms/llama-index-llms-cortex/llama_index/llms/cortex/__init__.py
llama-index-integrations/llms/llama-index-llms-cortex/llama_index/llms/cortex/__init__.py
from llama_index.llms.cortex.base import Cortex __all__ = ["Cortex"]
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/llms/llama-index-llms-cortex/llama_index/llms/cortex/base.py
llama-index-integrations/llms/llama-index-llms-cortex/llama_index/llms/cortex/base.py
import json import os from typing import Any, Dict, Optional, Sequence import warnings import aiohttp import requests from llama_index.core.base.llms.types import MessageRole from llama_index.core.bridge.pydantic import Field from llama_index.core.llms import ( ChatMessage, ChatResponse, ChatResponseAsyncG...
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/llms/llama-index-llms-vertex/tests/test_llms_vertex.py
llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py
from llama_index.llms.vertex import Vertex def test_vertex_metadata_function_calling(): """Test that Vertex LLM metadata correctly identifies Gemini models as function calling models.""" # This test uses mocks to avoid actual API calls from unittest.mock import patch, Mock with patch( "llama_...
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/llms/llama-index-llms-vertex/tests/test_gemini_utils.py
llama-index-integrations/llms/llama-index-llms-vertex/tests/test_gemini_utils.py
import pytest from google.cloud.aiplatform_v1beta1 import FunctionCall from llama_index.core.base.llms.types import ( ChatMessage, MessageRole, TextBlock, ImageBlock, ) from llama_index.llms.vertex.gemini_utils import ( convert_chat_message_to_gemini_content, is_gemini_model, ) def test_is_gem...
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/llms/llama-index-llms-vertex/tests/test_tool_required.py
llama-index-integrations/llms/llama-index-llms-vertex/tests/test_tool_required.py
from unittest.mock import Mock, patch from llama_index.core.tools import FunctionTool from llama_index.llms.vertex import Vertex from vertexai.generative_models import ToolConfig def search(query: str) -> str: """Search for information about a query.""" return f"Results for {query}" def calculate(a: int, b...
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/llms/llama-index-llms-vertex/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-vertex/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/llms/llama-index-llms-vertex/llama_index/llms/vertex/gemini_utils.py
llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/gemini_utils.py
from typing import Any, Union, Optional from vertexai.generative_models._generative_models import SafetySettingsType from google.cloud.aiplatform_v1beta1.types import content as gapic_content_types from llama_index.core.llms import ChatMessage, MessageRole, ImageBlock, TextBlock def is_gemini_model(model: str) -> boo...
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/llms/llama-index-llms-vertex/llama_index/llms/vertex/utils.py
llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/utils.py
# utils script # generation with retry import logging from typing import Any, Callable, Optional import google.api_core import vertexai from tenacity import ( before_sleep_log, retry, retry_if_exception_type, stop_after_attempt, wait_exponential, ) from vertexai.language_models import ChatMessage ...
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/llms/llama-index-llms-vertex/llama_index/llms/vertex/__init__.py
llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/__init__.py
from llama_index.llms.vertex.base import Vertex __all__ = ["Vertex"]
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/llms/llama-index-llms-vertex/llama_index/llms/vertex/base.py
llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/base.py
import deprecated from typing import ( TYPE_CHECKING, Any, Callable, Dict, List, Tuple, Optional, Sequence, Union, ) from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, Completion...
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/llms/llama-index-llms-databricks/tests/test_llms_databricks.py
llama-index-integrations/llms/llama-index-llms-databricks/tests/test_llms_databricks.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.databricks import Databricks def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Databricks.__mro__] assert BaseLLM.__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/llms/llama-index-llms-databricks/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-databricks/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/llms/llama-index-llms-databricks/tests/test_integration_databricks.py
llama-index-integrations/llms/llama-index-llms-databricks/tests/test_integration_databricks.py
import os import pytest from llama_index.llms.databricks import Databricks @pytest.mark.skipif( "DATABRICKS_TOKEN" not in os.environ or "DATABRICKS_SERVING_ENDPOINT" not in os.environ, reason="DATABRICKS_TOKEN or DATABRICKS_SERVING_ENDPOINT not set in environment", ) def test_completion(): databrick...
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/llms/llama-index-llms-databricks/llama_index/llms/databricks/__init__.py
llama-index-integrations/llms/llama-index-llms-databricks/llama_index/llms/databricks/__init__.py
from llama_index.llms.databricks.base import Databricks __all__ = ["Databricks"]
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/llms/llama-index-llms-databricks/llama_index/llms/databricks/base.py
llama-index-integrations/llms/llama-index-llms-databricks/llama_index/llms/databricks/base.py
import os from typing import Any, Optional, Dict from llama_index.llms.openai_like import OpenAILike class Databricks(OpenAILike): """ Databricks LLM. Examples: `pip install llama-index-llms-databricks` ```python from llama_index.llms.databricks import Databricks # Set ...
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/llms/llama-index-llms-groq/tests/test_integration_groq.py
llama-index-integrations/llms/llama-index-llms-groq/tests/test_integration_groq.py
import os import pytest from llama_index.llms.groq import Groq @pytest.mark.skipif("GROQ_API_KEY" not in os.environ, reason="No Groq API key") def test_completion(): groq = Groq(model="llama3-70b-8192", temperature=0, max_tokens=2) resp = groq.complete("hello") assert resp.text == "Hello" @pytest.mark...
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/llms/llama-index-llms-groq/tests/test_llms_groq.py
llama-index-integrations/llms/llama-index-llms-groq/tests/test_llms_groq.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.groq import Groq def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Groq.__mro__] assert BaseLLM.__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/llms/llama-index-llms-groq/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-groq/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/llms/llama-index-llms-groq/llama_index/llms/groq/__init__.py
llama-index-integrations/llms/llama-index-llms-groq/llama_index/llms/groq/__init__.py
from llama_index.llms.groq.base import Groq __all__ = ["Groq"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false