code stringlengths 161 67.2k | apis listlengths 1 24 | extract_api stringlengths 164 53.3k |
|---|---|---|
"""Elasticsearch vector store."""
import asyncio
import uuid
from logging import getLogger
from typing import Any, Callable, Dict, List, Literal, Optional, Union, cast
import nest_asyncio
import numpy as np
from llama_index.schema import BaseNode, MetadataMode, TextNode
from llama_index.vector_stores.types import (
... | [
"llama_index.vector_stores.utils.metadata_dict_to_node",
"llama_index.schema.TextNode",
"llama_index.vector_stores.utils.node_to_metadata_dict"
] | [((534, 553), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (543, 553), False, 'from logging import getLogger\n'), ((2379, 2432), 'elasticsearch.AsyncElasticsearch', 'elasticsearch.AsyncElasticsearch', ([], {}), '(**connection_params)\n', (2411, 2432), False, 'import elasticsearch\n'), ((3755, 3... |
"""Elasticsearch vector store."""
import asyncio
import uuid
from logging import getLogger
from typing import Any, Callable, Dict, List, Literal, Optional, Union, cast
import nest_asyncio
import numpy as np
from llama_index.schema import BaseNode, MetadataMode, TextNode
from llama_index.vector_stores.types import (
... | [
"llama_index.vector_stores.utils.metadata_dict_to_node",
"llama_index.schema.TextNode",
"llama_index.vector_stores.utils.node_to_metadata_dict"
] | [((534, 553), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (543, 553), False, 'from logging import getLogger\n'), ((2379, 2432), 'elasticsearch.AsyncElasticsearch', 'elasticsearch.AsyncElasticsearch', ([], {}), '(**connection_params)\n', (2411, 2432), False, 'import elasticsearch\n'), ((3755, 3... |
"""Global eval handlers."""
from typing import Any
from llama_index.callbacks.arize_phoenix_callback import arize_phoenix_callback_handler
from llama_index.callbacks.base_handler import BaseCallbackHandler
from llama_index.callbacks.honeyhive_callback import honeyhive_callback_handler
from llama_index.callbacks.open_... | [
"llama_index.callbacks.wandb_callback.WandbCallbackHandler",
"llama_index.callbacks.honeyhive_callback.honeyhive_callback_handler",
"llama_index.callbacks.simple_llm_handler.SimpleLLMHandler",
"llama_index.callbacks.arize_phoenix_callback.arize_phoenix_callback_handler",
"llama_index.callbacks.promptlayer_h... | [((990, 1025), 'llama_index.callbacks.wandb_callback.WandbCallbackHandler', 'WandbCallbackHandler', ([], {}), '(**eval_params)\n', (1010, 1025), False, 'from llama_index.callbacks.wandb_callback import WandbCallbackHandler\n'), ((1083, 1126), 'llama_index.callbacks.open_inference_callback.OpenInferenceCallbackHandler',... |
"""Global eval handlers."""
from typing import Any
from llama_index.callbacks.arize_phoenix_callback import arize_phoenix_callback_handler
from llama_index.callbacks.base_handler import BaseCallbackHandler
from llama_index.callbacks.honeyhive_callback import honeyhive_callback_handler
from llama_index.callbacks.open_... | [
"llama_index.callbacks.wandb_callback.WandbCallbackHandler",
"llama_index.callbacks.honeyhive_callback.honeyhive_callback_handler",
"llama_index.callbacks.simple_llm_handler.SimpleLLMHandler",
"llama_index.callbacks.arize_phoenix_callback.arize_phoenix_callback_handler",
"llama_index.callbacks.promptlayer_h... | [((990, 1025), 'llama_index.callbacks.wandb_callback.WandbCallbackHandler', 'WandbCallbackHandler', ([], {}), '(**eval_params)\n', (1010, 1025), False, 'from llama_index.callbacks.wandb_callback import WandbCallbackHandler\n'), ((1083, 1126), 'llama_index.callbacks.open_inference_callback.OpenInferenceCallbackHandler',... |
"""Google GenerativeAI Attributed Question and Answering (AQA) service.
The GenAI Semantic AQA API is a managed end to end service that allows
developers to create responses grounded on specified passages based on
a user query. For more information visit:
https://developers.generativeai.google/guide
"""
import loggin... | [
"llama_index.legacy.core.response.schema.Response",
"llama_index.legacy.schema.TextNode",
"llama_index.legacy.indices.query.schema.QueryBundle",
"llama_index.legacy.vector_stores.google.generativeai.genai_extension.build_generative_service"
] | [((1114, 1141), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1131, 1141), False, 'import logging\n'), ((2809, 2842), 'llama_index.legacy.vector_stores.google.generativeai.genai_extension.build_generative_service', 'genaix.build_generative_service', ([], {}), '()\n', (2840, 2842), True,... |
"""Google GenerativeAI Attributed Question and Answering (AQA) service.
The GenAI Semantic AQA API is a managed end to end service that allows
developers to create responses grounded on specified passages based on
a user query. For more information visit:
https://developers.generativeai.google/guide
"""
import loggin... | [
"llama_index.legacy.core.response.schema.Response",
"llama_index.legacy.schema.TextNode",
"llama_index.legacy.indices.query.schema.QueryBundle",
"llama_index.legacy.vector_stores.google.generativeai.genai_extension.build_generative_service"
] | [((1114, 1141), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1131, 1141), False, 'import logging\n'), ((2809, 2842), 'llama_index.legacy.vector_stores.google.generativeai.genai_extension.build_generative_service', 'genaix.build_generative_service', ([], {}), '()\n', (2840, 2842), True,... |
"""Elasticsearch vector store."""
import asyncio
import uuid
from logging import getLogger
from typing import Any, Callable, Dict, List, Literal, Optional, Union, cast
import nest_asyncio
import numpy as np
from llama_index.legacy.bridge.pydantic import PrivateAttr
from llama_index.legacy.schema import BaseNode, Met... | [
"llama_index.legacy.bridge.pydantic.PrivateAttr",
"llama_index.legacy.schema.TextNode",
"llama_index.legacy.vector_stores.utils.node_to_metadata_dict",
"llama_index.legacy.vector_stores.utils.metadata_dict_to_node"
] | [((640, 659), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (649, 659), False, 'from logging import getLogger\n'), ((2343, 2396), 'elasticsearch.AsyncElasticsearch', 'elasticsearch.AsyncElasticsearch', ([], {}), '(**connection_params)\n', (2375, 2396), False, 'import elasticsearch\n'), ((3719, 3... |
"""Elasticsearch vector store."""
import asyncio
import uuid
from logging import getLogger
from typing import Any, Callable, Dict, List, Literal, Optional, Union, cast
import nest_asyncio
import numpy as np
from llama_index.legacy.bridge.pydantic import PrivateAttr
from llama_index.legacy.schema import BaseNode, Met... | [
"llama_index.legacy.bridge.pydantic.PrivateAttr",
"llama_index.legacy.schema.TextNode",
"llama_index.legacy.vector_stores.utils.node_to_metadata_dict",
"llama_index.legacy.vector_stores.utils.metadata_dict_to_node"
] | [((640, 659), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (649, 659), False, 'from logging import getLogger\n'), ((2343, 2396), 'elasticsearch.AsyncElasticsearch', 'elasticsearch.AsyncElasticsearch', ([], {}), '(**connection_params)\n', (2375, 2396), False, 'import elasticsearch\n'), ((3719, 3... |
"""Google Generative AI Vector Store.
The GenAI Semantic Retriever API is a managed end-to-end service that allows
developers to create a corpus of documents to perform semantic search on
related passages given a user query. For more information visit:
https://developers.generativeai.google/guide
"""
import logging
i... | [
"llama_index.vector_stores.google.genai_extension.build_semantic_retriever",
"llama_index.vector_stores.google.genai_extension.get_corpus",
"llama_index.vector_stores.google.genai_extension.Config",
"llama_index.vector_stores.google.genai_extension.EntityName.from_str",
"llama_index.core.bridge.pydantic.Fie... | [((812, 839), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (829, 839), False, 'import logging\n'), ((2859, 2881), 'llama_index.vector_stores.google.genai_extension.Config', 'genaix.Config', ([], {}), '(**attrs)\n', (2872, 2881), True, 'import llama_index.vector_stores.google.genai_exten... |
"""Google GenerativeAI Attributed Question and Answering (AQA) service.
The GenAI Semantic AQA API is a managed end to end service that allows
developers to create responses grounded on specified passages based on
a user query. For more information visit:
https://developers.generativeai.google/guide
"""
import loggin... | [
"llama_index.indices.query.schema.QueryBundle",
"llama_index.schema.TextNode",
"llama_index.vector_stores.google.generativeai.genai_extension.build_generative_service",
"llama_index.core.response.schema.Response"
] | [((1051, 1078), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1068, 1078), False, 'import logging\n'), ((2739, 2772), 'llama_index.vector_stores.google.generativeai.genai_extension.build_generative_service', 'genaix.build_generative_service', ([], {}), '()\n', (2770, 2772), True, 'impor... |
"""FastAPI app creation, logger configuration and main API routes."""
import llama_index
from private_gpt.di import global_injector
from private_gpt.launcher import create_app
# Add LlamaIndex simple observability
llama_index.set_global_handler("simple")
app = create_app(global_injector)
| [
"llama_index.set_global_handler"
] | [((217, 257), 'llama_index.set_global_handler', 'llama_index.set_global_handler', (['"""simple"""'], {}), "('simple')\n", (247, 257), False, 'import llama_index\n'), ((265, 292), 'private_gpt.launcher.create_app', 'create_app', (['global_injector'], {}), '(global_injector)\n', (275, 292), False, 'from private_gpt.launc... |
"""FastAPI app creation, logger configuration and main API routes."""
import llama_index
from private_gpt.di import global_injector
from private_gpt.launcher import create_app
# Add LlamaIndex simple observability
llama_index.set_global_handler("simple")
app = create_app(global_injector)
| [
"llama_index.set_global_handler"
] | [((217, 257), 'llama_index.set_global_handler', 'llama_index.set_global_handler', (['"""simple"""'], {}), "('simple')\n", (247, 257), False, 'import llama_index\n'), ((265, 292), 'private_gpt.launcher.create_app', 'create_app', (['global_injector'], {}), '(global_injector)\n', (275, 292), False, 'from private_gpt.launc... |
"""FastAPI app creation, logger configuration and main API routes."""
import llama_index
from private_gpt.di import global_injector
from private_gpt.launcher import create_app
# Add LlamaIndex simple observability
llama_index.set_global_handler("simple")
app = create_app(global_injector)
| [
"llama_index.set_global_handler"
] | [((217, 257), 'llama_index.set_global_handler', 'llama_index.set_global_handler', (['"""simple"""'], {}), "('simple')\n", (247, 257), False, 'import llama_index\n'), ((265, 292), 'private_gpt.launcher.create_app', 'create_app', (['global_injector'], {}), '(global_injector)\n', (275, 292), False, 'from private_gpt.launc... |
"""
Astra DB Vector store index.
An index based on a DB table with vector search capabilities,
powered by the astrapy library
"""
import json
import logging
from typing import Any, Dict, List, Optional, cast
from warnings import warn
import llama_index.core
from llama_index.core.bridge.pydantic import PrivateAttr
f... | [
"llama_index.core.vector_stores.utils.metadata_dict_to_node",
"llama_index.core.vector_stores.utils.node_to_metadata_dict",
"llama_index.core.indices.query.embedding_utils.get_top_k_mmr_embeddings",
"llama_index.core.bridge.pydantic.PrivateAttr",
"llama_index.core.vector_stores.types.VectorStoreQueryResult"... | [((852, 879), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (869, 879), False, 'import logging\n'), ((2070, 2083), 'llama_index.core.bridge.pydantic.PrivateAttr', 'PrivateAttr', ([], {}), '()\n', (2081, 2083), False, 'from llama_index.core.bridge.pydantic import PrivateAttr\n'), ((2118, ... |
from unittest.mock import MagicMock, patch
import pytest
from llama_index.legacy.core.response.schema import Response
from llama_index.legacy.schema import Document
try:
import google.ai.generativelanguage as genai
has_google = True
except ImportError:
has_google = False
from llama_index.legacy.indices.... | [
"llama_index.legacy.vector_stores.google.generativeai.genai_extension.get_config",
"llama_index.legacy.indices.managed.google.generativeai.GoogleIndex.create_corpus",
"llama_index.legacy.indices.managed.google.generativeai.GoogleIndex.from_corpus",
"llama_index.legacy.schema.Document",
"llama_index.legacy.i... | [((693, 752), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not has_google)'], {'reason': 'SKIP_TEST_REASON'}), '(not has_google, reason=SKIP_TEST_REASON)\n', (711, 752), False, 'import pytest\n'), ((754, 798), 'unittest.mock.patch', 'patch', (['"""google.auth.credentials.Credentials"""'], {}), "('google.auth.credent... |
from unittest.mock import MagicMock, patch
import pytest
try:
import google.ai.generativelanguage as genai
has_google = True
except ImportError:
has_google = False
from llama_index.legacy.response_synthesizers.google.generativeai import (
GoogleTextSynthesizer,
set_google_config,
)
from llama_in... | [
"llama_index.legacy.response_synthesizers.google.generativeai.GoogleTextSynthesizer.from_defaults",
"llama_index.legacy.schema.TextNode",
"llama_index.legacy.response_synthesizers.google.generativeai.set_google_config",
"llama_index.legacy.vector_stores.google.generativeai.genai_extension.get_config"
] | [((663, 722), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not has_google)'], {'reason': 'SKIP_TEST_REASON'}), '(not has_google, reason=SKIP_TEST_REASON)\n', (681, 722), False, 'import pytest\n'), ((724, 768), 'unittest.mock.patch', 'patch', (['"""google.auth.credentials.Credentials"""'], {}), "('google.auth.credent... |
from typing import Any, Dict, List, Optional, Tuple
from llama_index.core.base.base_query_engine import BaseQueryEngine
from llama_index.core.base.response.schema import RESPONSE_TYPE
from llama_index.core.callbacks.schema import CBEventType, EventPayload
from llama_index.core.indices.composability.graph import Compos... | [
"llama_index.core.instrumentation.get_dispatcher",
"llama_index.core.settings.callback_manager_from_settings_or_context",
"llama_index.core.schema.NodeWithScore"
] | [((585, 620), 'llama_index.core.instrumentation.get_dispatcher', 'instrument.get_dispatcher', (['__name__'], {}), '(__name__)\n', (610, 620), True, 'import llama_index.core.instrumentation as instrument\n'), ((1649, 1734), 'llama_index.core.settings.callback_manager_from_settings_or_context', 'callback_manager_from_set... |
from llama_index import (
SimpleDirectoryReader,
VectorStoreIndex,
ServiceContext,
)
from llama_index.llms import LlamaCPP
from llama_index.llms.llama_utils import messages_to_prompt, completion_to_prompt
import llama_index.llms.llama_cpp
from langchain.embeddings import HuggingFaceEmbeddings
import co... | [
"llama_index.VectorStoreIndex.from_documents",
"llama_index.ServiceContext.from_defaults",
"llama_index.SimpleDirectoryReader"
] | [((431, 491), 'langchain.embeddings.HuggingFaceEmbeddings', 'HuggingFaceEmbeddings', ([], {'model_name': 'config.EMBEDDING_MODEL_URL'}), '(model_name=config.EMBEDDING_MODEL_URL)\n', (452, 491), False, 'from langchain.embeddings import HuggingFaceEmbeddings\n'), ((538, 600), 'llama_index.ServiceContext.from_defaults', '... |
import time
import llama_index
from atlassian import Bitbucket
import os
import sys
sys.path.append('../')
import local_secrets as secrets
start_time = time.time()
stash = Bitbucket('https://git.techstyle.net', token=secrets.stash_token)
os.environ['OPENAI_API_KEY'] = secrets.techstyle_openai_key
project ='DATASICENCE... | [
"llama_index.GPTSimpleVectorIndex",
"llama_index.Document"
] | [((84, 106), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (99, 106), False, 'import sys\n'), ((153, 164), 'time.time', 'time.time', ([], {}), '()\n', (162, 164), False, 'import time\n'), ((173, 238), 'atlassian.Bitbucket', 'Bitbucket', (['"""https://git.techstyle.net"""'], {'token': 'secrets.... |
import qdrant_client
from llama_index import (
VectorStoreIndex,
ServiceContext,
)
from llama_index.llms import Ollama
from llama_index.vector_stores.qdrant import QdrantVectorStore
import llama_index
llama_index.set_global_handler("simple")
# re-initialize the vector store
client = qdrant_client.QdrantClient... | [
"llama_index.ServiceContext.from_defaults",
"llama_index.set_global_handler",
"llama_index.vector_stores.qdrant.QdrantVectorStore",
"llama_index.VectorStoreIndex.from_vector_store",
"llama_index.llms.Ollama"
] | [((210, 250), 'llama_index.set_global_handler', 'llama_index.set_global_handler', (['"""simple"""'], {}), "('simple')\n", (240, 250), False, 'import llama_index\n'), ((294, 342), 'qdrant_client.QdrantClient', 'qdrant_client.QdrantClient', ([], {'path': '"""./qdrant_data"""'}), "(path='./qdrant_data')\n", (320, 342), Fa... |
## main function of AWS Lambda function
import llama_index
from llama_index import download_loader
import boto3
import json
import urllib.parse
from llama_index import SimpleDirectoryReader
def main(event, context):
# extracting s3 bucket and key information from SQS message
print(event)
s3_info = json.lo... | [
"llama_index.download_loader"
] | [((313, 352), 'json.loads', 'json.loads', (["event['Records'][0]['body']"], {}), "(event['Records'][0]['body'])\n", (323, 352), False, 'import json\n'), ((628, 692), 'llama_index.download_loader', 'download_loader', (['"""S3Reader"""'], {'custom_path': '"""/tmp/llamahub_modules"""'}), "('S3Reader', custom_path='/tmp/ll... |
"""Download."""
import json
import logging
import os
import subprocess
import sys
from enum import Enum
from importlib import util
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import pkg_resources
import requests
from pkg_resources import DistributionNotFound
from llama_index.download.... | [
"llama_index.download.utils.get_exports",
"llama_index.download.utils.initialize_directory"
] | [((637, 664), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (654, 664), False, 'import logging\n'), ((5550, 5583), 'os.path.exists', 'os.path.exists', (['requirements_path'], {}), '(requirements_path)\n', (5564, 5583), False, 'import os\n'), ((7403, 7471), 'llama_index.download.utils.ini... |
import json
from typing import Dict, List
import llama_index.query_engine
from llama_index import ServiceContext, QueryBundle
from llama_index.callbacks import CBEventType, LlamaDebugHandler, CallbackManager
from llama_index.indices.base import BaseIndex
from llama_index.indices.query.base import BaseQueryEngine
from ... | [
"llama_index.ServiceContext.from_defaults",
"llama_index.callbacks.CallbackManager",
"llama_index.callbacks.LlamaDebugHandler",
"llama_index.response.schema.Response"
] | [((1298, 1324), 'llama_index.response.schema.Response', 'Response', (['f"""我是{self.name}"""'], {}), "(f'我是{self.name}')\n", (1306, 1324), False, 'from llama_index.response.schema import RESPONSE_TYPE, Response\n'), ((2530, 2571), 'common.llm.create_llm', 'create_llm', (['cb_manager', 'LLM_CACHE_ENABLED'], {}), '(cb_man... |
"""Download."""
import json
import logging
import os
import subprocess
import sys
from enum import Enum
from importlib import util
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import pkg_resources
import requests
from pkg_resources import DistributionNotFound
from llama_index.download.... | [
"llama_index.download.utils.get_exports",
"llama_index.download.utils.initialize_directory"
] | [((637, 664), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (654, 664), False, 'import logging\n'), ((5550, 5583), 'os.path.exists', 'os.path.exists', (['requirements_path'], {}), '(requirements_path)\n', (5564, 5583), False, 'import os\n'), ((7403, 7471), 'llama_index.download.utils.ini... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.