text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# AgentSearch Loader
This framework facilitates seamless integration with the AgentSearch dataset or hosted search APIs (e.g. Search Engines) and with RAG-specialized LLM's (e.g. Search Agents).
During query-time, the user passes in the query string, search provider (`bing`, `agent-search`), and RAG provider model (`... | llama_index/llama-index-integrations/readers/llama-index-readers-agent-search/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-agent-search/README.md",
"repo_id": "llama_index",
"token_count": 390
} | 1,276 |
fn main() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
console_error_panic_hook::set_once();
yew::Renderer::<candle_wasm_example_llama2::App>::new().render();
}
| candle/candle-wasm-examples/llama2-c/src/bin/app.rs/0 | {
"file_path": "candle/candle-wasm-examples/llama2-c/src/bin/app.rs",
"repo_id": "candle",
"token_count": 83
} | 73 |
# Required Environment Variables: SCIPHI_API_KEY
import os
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
AgentSearchRetrieverPack = download_llama_pack(
"AgentSearchRetrieverPack", "./agent_search_pack... | llama_index/llama-index-packs/llama-index-packs-agent-search-retriever/examples/example.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-agent-search-retriever/examples/example.py",
"repo_id": "llama_index",
"token_count": 227
} | 1,688 |
# flake8: noqa
"""Global values and configuration that apply to all of LangChain."""
import warnings
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from langchain_core.caches import BaseCache
# DO NOT USE THESE VALUES DIRECTLY!
# Use them only via `get_<X>()` and `set_<X>()` below,
# or else your c... | langchain/libs/core/langchain_core/globals/__init__.py/0 | {
"file_path": "langchain/libs/core/langchain_core/globals/__init__.py",
"repo_id": "langchain",
"token_count": 3429
} | 389 |
use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT};
use crate::{CpuStorage, DType, Layout, Result, Shape};
pub trait BackendStorage: Sized {
type Device: BackendDevice;
fn try_clone(&self, _: &Layout) -> Result<Self>;
fn dtype(&self) -> DType;
fn device(&self) -> &Self::Device;
// Maybe this... | candle/candle-core/src/backend.rs/0 | {
"file_path": "candle/candle-core/src/backend.rs",
"repo_id": "candle",
"token_count": 1732
} | 28 |
# LlamaIndex Readers Integration: Couchbase
This loader loads documents from Couchbase cluster.
The user specifies a Couchbase client or credentials to initialize the reader. They can specify the SQL++ query to
fetch the relevant docs.
## Usage
Here's an example usage of the CouchbaseReader.
```python
from llama_in... | llama_index/llama-index-integrations/readers/llama-index-readers-couchbase/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-couchbase/README.md",
"repo_id": "llama_index",
"token_count": 629
} | 1,277 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/convnextv2/test_modeling_convnextv2.py/0 | {
"file_path": "transformers/tests/models/convnextv2/test_modeling_convnextv2.py",
"repo_id": "transformers",
"token_count": 5523
} | 738 |
# coding=utf-8
# Copyright 2020 The Trax Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | transformers/src/transformers/models/reformer/configuration_reformer.py/0 | {
"file_path": "transformers/src/transformers/models/reformer/configuration_reformer.py",
"repo_id": "transformers",
"token_count": 5139
} | 660 |
import { ChatOpenAI } from "@langchain/openai";
import { createSqlQueryChain } from "langchain/chains/sql_db";
import { SqlDatabase } from "langchain/sql_db";
import { DataSource } from "typeorm";
import { QuerySqlTool } from "langchain/tools/sql";
import { PromptTemplate } from "@langchain/core/prompts";
import { Stri... | langchainjs/examples/src/use_cases/sql/quickstart_answer_question.ts/0 | {
"file_path": "langchainjs/examples/src/use_cases/sql/quickstart_answer_question.ts",
"repo_id": "langchainjs",
"token_count": 464
} | 890 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/core/src/common/BitsetView.h/0 | {
"file_path": "milvus/internal/core/src/common/BitsetView.h",
"repo_id": "milvus",
"token_count": 865
} | 1,721 |
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.__... | llama_index/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/test_program_lmformatenforcer.py/0 | {
"file_path": "llama_index/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/test_program_lmformatenforcer.py",
"repo_id": "llama_index",
"token_count": 123
} | 1,303 |
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_ext, path="/rag-vectara")```<jupyter_code>from langserve.client import RemoteRunnable
rag_app_vectara = RemoteRunnable("http://localhost:8000/rag-vectara")
rag_app_vectara.invoke("How does agent memory work?")<jupyter_output><empty_... | langchain/templates/rag-vectara/rag_vectara.ipynb/0 | {
"file_path": "langchain/templates/rag-vectara/rag_vectara.ipynb",
"repo_id": "langchain",
"token_count": 125
} | 672 |
<jupyter_start><jupyter_text>Voyage AI>[Voyage AI](https://www.voyageai.com/) provides cutting-edge embedding/vectorizations models.Let's load the Voyage Embedding class.<jupyter_code>from langchain_community.embeddings import VoyageEmbeddings<jupyter_output><empty_output><jupyter_text>Voyage AI utilizes API keys to mo... | langchain/docs/docs/integrations/text_embedding/voyageai.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/text_embedding/voyageai.ipynb",
"repo_id": "langchain",
"token_count": 765
} | 173 |
package dbmodel
import (
"time"
"github.com/chroma/chroma-coordinator/internal/types"
)
type Tenant struct {
ID string `gorm:"id;primaryKey;unique"`
Ts types.Timestamp `gorm:"ts;type:bigint;default:0"`
IsDeleted bool `gorm:"is_deleted;type:bool;default:false"`
CreatedAt time.T... | chroma/go/coordinator/internal/metastore/db/dbmodel/tenant.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/tenant.go",
"repo_id": "chroma",
"token_count": 312
} | 52 |
<jupyter_start><jupyter_text>Cohere Basic Usage Call `complete` with a prompt If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-openai
%pip install llama-index-llms-cohere
!pip install llama-index
from llama_index.llms.cohere import C... | llama_index/docs/examples/llm/cohere.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/cohere.ipynb",
"repo_id": "llama_index",
"token_count": 1320
} | 1,087 |
"""
CoaT architecture.
Paper: Co-Scale Conv-Attentional Image Transformers - https://arxiv.org/abs/2104.06399
Official CoaT code at: https://github.com/mlpc-ucsd/CoaT
Modified from timm/models/vision_transformer.py
"""
from functools import partial
from typing import Tuple, List, Union
import torch
import torch.nn... | pytorch-image-models/timm/models/coat.py/0 | {
"file_path": "pytorch-image-models/timm/models/coat.py",
"repo_id": "pytorch-image-models",
"token_count": 15685
} | 395 |
/* eslint-disable @typescript-eslint/no-explicit-any */
import { expect, test } from "@jest/globals";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { Operation, applyPatch } from "@langchain/core/utils/json_patch";
import { ChatOpenAI } from "@langchain/openai";
import { ChatPr... | langchainjs/langchain/src/output_parsers/tests/openai_functions.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/tests/openai_functions.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1075
} | 1,005 |
# coding=utf-8
# Copyright 2022 The REALM authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | transformers/src/transformers/models/realm/configuration_realm.py/0 | {
"file_path": "transformers/src/transformers/models/realm/configuration_realm.py",
"repo_id": "transformers",
"token_count": 3471
} | 649 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,640 |
use crate::tokenizer::{Decoder, Result};
use monostate::MustBe;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Clone, Debug, Serialize, Default)]
/// ByteFallback is a simple trick which converts tokens looking like `<0x61>`
/// to pure bytes, and attempts to make them into a string. If the tokens
/// can... | tokenizers/tokenizers/src/decoders/byte_fallback.rs/0 | {
"file_path": "tokenizers/tokenizers/src/decoders/byte_fallback.rs",
"repo_id": "tokenizers",
"token_count": 1938
} | 463 |
from langchain_community.graphs import __all__
EXPECTED_ALL = [
"MemgraphGraph",
"NetworkxEntityGraph",
"Neo4jGraph",
"NebulaGraph",
"NeptuneGraph",
"NeptuneRdfGraph",
"KuzuGraph",
"HugeGraph",
"RdfGraph",
"ArangoGraph",
"FalkorDBGraph",
"TigerGraph",
"OntotextGraphD... | langchain/libs/community/tests/unit_tests/graphs/test_imports.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/graphs/test_imports.py",
"repo_id": "langchain",
"token_count": 188
} | 399 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "llms/replicate",
});
export * from "@langchain/community/llms/replicate";
| langchainjs/langchain/src/llms/replicate.ts/0 | {
"file_path": "langchainjs/langchain/src/llms/replicate.ts",
"repo_id": "langchainjs",
"token_count": 72
} | 931 |
from llama_index.readers.astra_db.base import AstraDBReader
__all__ = ["AstraDBReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/llama_index/readers/astra_db/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/llama_index/readers/astra_db/__init__.py",
"repo_id": "llama_index",
"token_count": 33
} | 1,407 |
"""Serialization and deserialization."""
from langchain_core.load.dump import dumpd, dumps
from langchain_core.load.load import load, loads
from langchain_core.load.serializable import Serializable
__all__ = ["dumpd", "dumps", "load", "loads", "Serializable"]
| langchain/libs/core/langchain_core/load/__init__.py/0 | {
"file_path": "langchain/libs/core/langchain_core/load/__init__.py",
"repo_id": "langchain",
"token_count": 77
} | 423 |
import CodeBlock from "@theme/CodeBlock";
# Fallbacks
When working with language models, you may often encounter issues from the underlying APIs, e.g. rate limits or downtime.
Therefore, as you move your LLM applications into production it becomes more and more important to have contingencies for errors.
That's why w... | langchainjs/docs/core_docs/docs/guides/fallbacks.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/guides/fallbacks.mdx",
"repo_id": "langchainjs",
"token_count": 715
} | 726 |
# ResNet-D
**ResNet-D** is a modification on the [ResNet](https://paperswithcode.com/method/resnet) architecture that utilises an [average pooling](https://paperswithcode.com/method/average-pooling) tweak for downsampling. The motivation is that in the unmodified ResNet, the [1×1 convolution](https://paperswithcode.co... | pytorch-image-models/docs/models/resnet-d.md/0 | {
"file_path": "pytorch-image-models/docs/models/resnet-d.md",
"repo_id": "pytorch-image-models",
"token_count": 3929
} | 371 |
accuracy:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_7/sift_50m_2048_128_ip_sq8_wal
cache_config.cpu_cache_capacity: 30
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_threshold: 1
gpu_resource_config.enable: true
gpu_r... | milvus/tests/benchmark/milvus_benchmark/suites/cpu_accuracy.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/cpu_accuracy.yaml",
"repo_id": "milvus",
"token_count": 1033
} | 2,093 |
import tempfile
import torch
from diffusers import IPNDMScheduler
from .test_schedulers import SchedulerCommonTest
class IPNDMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (IPNDMScheduler,)
forward_default_kwargs = (("num_inference_steps", 50),)
def get_scheduler_config(self, **kwargs):
... | diffusers/tests/schedulers/test_scheduler_ipndm.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_ipndm.py",
"repo_id": "diffusers",
"token_count": 3120
} | 275 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/mq/mqimpl/rocksmq/client/consumer.go/0 | {
"file_path": "milvus/internal/mq/mqimpl/rocksmq/client/consumer.go",
"repo_id": "milvus",
"token_count": 553
} | 2,002 |
import streamlit as st
from langchain.callbacks.manager import collect_runs
from langchain import memory as lc_memory
from langsmith import Client
from streamlit_feedback import streamlit_feedback
from expression_chain import get_expression_chain
client = Client()
st.set_page_config(
page_title="Capturing User Fe... | langsmith-cookbook/feedback-examples/streamlit/main.py/0 | {
"file_path": "langsmith-cookbook/feedback-examples/streamlit/main.py",
"repo_id": "langsmith-cookbook",
"token_count": 1652
} | 1,059 |
# Introduction
{{#include ../../README.md:features}}
This book will introduce step by step how to use `candle`.
| candle/candle-book/src/README.md/0 | {
"file_path": "candle/candle-book/src/README.md",
"repo_id": "candle",
"token_count": 34
} | 26 |
from pathlib import Path
from langchain_community.document_loaders.obsidian import ObsidianLoader
OBSIDIAN_EXAMPLE_PATH = Path(__file__).parent / "sample_documents" / "obsidian"
STANDARD_METADATA_FIELDS = {
"created",
"path",
"source",
"last_accessed",
"last_modified",
}
loader = ObsidianLoader(s... | langchain/libs/community/tests/unit_tests/document_loaders/test_obsidian.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_obsidian.py",
"repo_id": "langchain",
"token_count": 1842
} | 374 |
import inspect
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax
if is_flax_available():
import jax
@require_flax
class FlaxModelTesterMixin:
def test_output(self):
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()
mo... | diffusers/tests/models/test_modeling_common_flax.py/0 | {
"file_path": "diffusers/tests/models/test_modeling_common_flax.py",
"repo_id": "diffusers",
"token_count": 1124
} | 246 |
# Copyright 2022 The HuggingFace Team and Brian Chao. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | accelerate/src/accelerate/commands/menu/helpers.py/0 | {
"file_path": "accelerate/src/accelerate/commands/menu/helpers.py",
"repo_id": "accelerate",
"token_count": 505
} | 11 |
import { OpenAI } from "@langchain/openai";
import type { Serialized } from "@langchain/core/load/serializable";
import { LLMResult } from "@langchain/core/outputs";
// We can pass in a list of CallbackHandlers to the LLM constructor to get callbacks for various events.
const model = new OpenAI({
callbacks: [
{
... | langchainjs/examples/src/models/llm/llm_debugging.ts/0 | {
"file_path": "langchainjs/examples/src/models/llm/llm_debugging.ts",
"repo_id": "langchainjs",
"token_count": 603
} | 903 |
"""Llama Dataset Class."""
import asyncio
import time
from typing import List, Optional
from pandas import DataFrame as PandasDataFrame
from llama_index.legacy.bridge.pydantic import Field
from llama_index.legacy.core.base_query_engine import BaseQueryEngine
from llama_index.legacy.llama_dataset.base import (
Ba... | llama_index/llama-index-legacy/llama_index/legacy/llama_dataset/rag.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/llama_dataset/rag.py",
"repo_id": "llama_index",
"token_count": 2109
} | 1,728 |
# LXMERT DEMO
1. make a virtualenv: ``virtualenv venv`` and activate ``source venv/bin/activate``
2. install reqs: ``pip install -r ./requirements.txt``
3. usage is as shown in demo.ipynb
| transformers/examples/research_projects/lxmert/README.md/0 | {
"file_path": "transformers/examples/research_projects/lxmert/README.md",
"repo_id": "transformers",
"token_count": 65
} | 605 |
import builtins
import json
from enum import Enum
from typing import List, Optional, Type, Union
from langchain_core.callbacks import AsyncCallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_community.tools.ainetwork.base import AINBaseTool
class AppOperationType(str, En... | langchain/libs/community/langchain_community/tools/ainetwork/app.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/ainetwork/app.py",
"repo_id": "langchain",
"token_count": 1315
} | 294 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 17,
"prefill": [
{
"id": 1276,
"logprob": null,
"text": "What"
},
{
"id": 310,
"logprob": -1.5117188,
"text": " is"... | text-generation-inference/integration-tests/models/__snapshots__/test_mpt/test_mpt_load.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mpt/test_mpt_load.json",
"repo_id": "text-generation-inference",
"token_count": 7884
} | 404 |
# coding=utf-8
# Copyright 2020 The Microsoft Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | transformers/src/transformers/models/prophetnet/modeling_prophetnet.py/0 | {
"file_path": "transformers/src/transformers/models/prophetnet/modeling_prophetnet.py",
"repo_id": "transformers",
"token_count": 48330
} | 719 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/hooks.py/0 | {
"file_path": "accelerate/src/accelerate/hooks.py",
"repo_id": "accelerate",
"token_count": 12920
} | 13 |
python_sources()
| llama_index/llama-index-integrations/callbacks/llama-index-callbacks-aim/llama_index/callbacks/aim/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-aim/llama_index/callbacks/aim/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,168 |
# Required Environment Variables: OPENAI_API_KEY, CS_TOKEN, CS_API_KEY
import os
from llama_index.core.llama_pack import download_llama_pack
# Set up Cogniswitch Credentials
cogniswitch_tool_args = {
"cs_token": os.getenv("CS_TOKEN"),
"apiKey": os.getenv("CS_API_KEY"),
}
# download and install dependencies
Co... | llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/examples/example.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/examples/example.py",
"repo_id": "llama_index",
"token_count": 244
} | 1,560 |
# Copyright 2023 The Intel Labs Team Authors, The Microsoft Research Team Authors and HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | transformers/src/transformers/models/bridgetower/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/bridgetower/__init__.py",
"repo_id": "transformers",
"token_count": 1071
} | 609 |
<jupyter_start><jupyter_text>Faiss Vector Store If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-vector-stores-faiss
!pip install llama-index<jupyter_output><empty_output><jupyter_text>Creating a Faiss Index<jupyter_code>import logging
impo... | llama_index/docs/examples/vector_stores/FaissIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/FaissIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 786
} | 1,166 |
# coding=utf-8
# Copyright 2022, UCLA NLP, The Facebook AI Research Team and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | transformers/src/transformers/models/plbart/configuration_plbart.py/0 | {
"file_path": "transformers/src/transformers/models/plbart/configuration_plbart.py",
"repo_id": "transformers",
"token_count": 3557
} | 656 |
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Dict, List, Optional
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import (
BaseMessage,
message_to_dict,
messages_from_dict,
messages_to_dict,
)
if TYPE_CHECKING:
fro... | langchain/libs/community/langchain_community/chat_message_histories/dynamodb.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_message_histories/dynamodb.py",
"repo_id": "langchain",
"token_count": 2981
} | 222 |
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
name: test-querynode-pod-kill
namespace: chaos-testing
annotations:
experiment.chaos-mesh.org/pause: 'false'
spec:
schedule: '*/5 * * * * *'
startingDeadlineSeconds: 60
concurrencyPolicy: Forbid
historyLimit: 1
type: PodChaos
podChaos:
... | milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_querynode_pod_kill.yaml/0 | {
"file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_querynode_pod_kill.yaml",
"repo_id": "milvus",
"token_count": 245
} | 2,028 |
from llama_index.embeddings.elasticsearch.base import ElasticsearchEmbedding
__all__ = ["ElasticsearchEmbedding"]
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/__init__.py",
"repo_id": "llama_index",
"token_count": 36
} | 1,304 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/optimization/torch2.0.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/torch2.0.md",
"repo_id": "diffusers",
"token_count": 7437
} | 168 |
<jupyter_start><jupyter_text>Nomic EmbeddingNomic has released v1.5 🪆🪆🪆 is capable of variable sized embeddings with matryoshka learning and an 8192 context, embedding dimensions between 64 and 768.In this notebook, we will explore using Nomic v1.5 embedding at different dimensions. Installation<jupyter_code>%pip i... | llama_index/docs/examples/embeddings/nomic.ipynb/0 | {
"file_path": "llama_index/docs/examples/embeddings/nomic.ipynb",
"repo_id": "llama_index",
"token_count": 1534
} | 1,079 |
from __future__ import annotations
import asyncio
from concurrent.futures import Executor, Future, ThreadPoolExecutor
from contextlib import contextmanager
from contextvars import ContextVar, copy_context
from functools import partial
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Di... | langchain/libs/core/langchain_core/runnables/config.py/0 | {
"file_path": "langchain/libs/core/langchain_core/runnables/config.py",
"repo_id": "langchain",
"token_count": 7287
} | 436 |
<jupyter_start><jupyter_text>MultiOn [MultiON](https://www.multion.ai/blog/multion-building-a-brighter-future-for-humanity-with-ai-agents) has built an AI Agent that can interact with a broad array of web services and applications. This notebook walks you through connecting LangChain to the `MultiOn` Client in your bro... | langchain/docs/docs/integrations/toolkits/multion.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/toolkits/multion.ipynb",
"repo_id": "langchain",
"token_count": 839
} | 175 |
# Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | peft/src/peft/tuners/lora/bnb.py/0 | {
"file_path": "peft/src/peft/tuners/lora/bnb.py",
"repo_id": "peft",
"token_count": 8131
} | 347 |
python_sources()
python_tests(
name="tests",
)
| llama_index/llama-index-core/tests/prompts/BUILD/0 | {
"file_path": "llama_index/llama-index-core/tests/prompts/BUILD",
"repo_id": "llama_index",
"token_count": 22
} | 1,213 |
import pytest
from llama_index.legacy.output_parsers.base import StructuredOutput
from llama_index.legacy.output_parsers.selection import SelectionOutputParser
@pytest.fixture()
def output_parser() -> SelectionOutputParser:
return SelectionOutputParser()
def test_format(output_parser: SelectionOutputParser) -> ... | llama_index/llama-index-legacy/tests/output_parsers/test_selection.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/output_parsers/test_selection.py",
"repo_id": "llama_index",
"token_count": 1109
} | 1,644 |
import hashlib
import hypothesis
import hypothesis.strategies as st
from typing import Any, Optional, List, Dict, Union, cast
from typing_extensions import TypedDict
import uuid
import numpy as np
import numpy.typing as npt
import chromadb.api.types as types
import re
from hypothesis.strategies._internal.strategies imp... | chroma/chromadb/test/property/strategies.py/0 | {
"file_path": "chroma/chromadb/test/property/strategies.py",
"repo_id": "chroma",
"token_count": 8584
} | 24 |
# coding=utf-8
# Copyright 2020 Ecole Polytechnique and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | transformers/tests/models/barthez/test_tokenization_barthez.py/0 | {
"file_path": "transformers/tests/models/barthez/test_tokenization_barthez.py",
"repo_id": "transformers",
"token_count": 2393
} | 799 |
import { OpenAI } from "@langchain/openai";
const model = new OpenAI({ temperature: 0 });
const res = await model.call(
"What would be a good company name a company that makes colorful socks?",
{
options: {
headers: {
"User-Id": "123",
},
},
}
);
console.log(res);
| langchainjs/examples/src/models/llm/openai_userid.ts/0 | {
"file_path": "langchainjs/examples/src/models/llm/openai_userid.ts",
"repo_id": "langchainjs",
"token_count": 113
} | 840 |
# OpenLLM
This page demonstrates how to use [OpenLLM](https://github.com/bentoml/OpenLLM)
with LangChain.
`OpenLLM` is an open platform for operating large language models (LLMs) in
production. It enables developers to easily run inference with any open-source
LLMs, deploy to the cloud or on-premises, and build power... | langchain/docs/docs/integrations/providers/openllm.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/openllm.mdx",
"repo_id": "langchain",
"token_count": 547
} | 152 |
import { loadSummarizationChain } from "langchain/chains";
import { SearchApiLoader } from "langchain/document_loaders/web/searchapi";
import { TokenTextSplitter } from "langchain/text_splitter";
import { PromptTemplate } from "@langchain/core/prompts";
import { ChatAnthropic } from "@langchain/anthropic";
const loade... | langchainjs/examples/src/use_cases/youtube/podcast_summary.ts/0 | {
"file_path": "langchainjs/examples/src/use_cases/youtube/podcast_summary.ts",
"repo_id": "langchainjs",
"token_count": 1077
} | 848 |
import { Runnable } from "../runnables/index.js";
import type { RunnableConfig } from "../runnables/config.js";
import type { BasePromptValueInterface } from "../prompt_values.js";
import type { BaseMessage } from "../messages/index.js";
import type { Callbacks } from "../callbacks/manager.js";
import type { Generation... | langchainjs/langchain-core/src/output_parsers/base.ts/0 | {
"file_path": "langchainjs/langchain-core/src/output_parsers/base.ts",
"repo_id": "langchainjs",
"token_count": 1893
} | 861 |
from langchain.indexes import __all__
def test_all() -> None:
"""Use to catch obvious breaking changes."""
assert __all__ == sorted(__all__, key=str.lower)
assert __all__ == [
"aindex",
"GraphIndexCreator",
"index",
"IndexingResult",
"SQLRecordManager",
"Vec... | langchain/libs/langchain/tests/unit_tests/indexes/test_api.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/indexes/test_api.py",
"repo_id": "langchain",
"token_count": 149
} | 598 |
from __future__ import annotations
from enum import Enum
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional
if TYPE_CHECKING:
from streamlit.delta_generator import DeltaGenerator
from streamlit.type_util import SupportsStr
class ChildType(Enum):
"""The enumerator of the child type."... | langchain/libs/community/langchain_community/callbacks/streamlit/mutable_expander.py/0 | {
"file_path": "langchain/libs/community/langchain_community/callbacks/streamlit/mutable_expander.py",
"repo_id": "langchain",
"token_count": 2191
} | 217 |
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
dbmodel "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel"
mock "github.com/stretchr/testify/mock"
types "github.com/chroma/chroma-coordinator/internal/types"
)
// ISegmentDb is an autogenerated mock type for the ISegment... | chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ISegmentDb.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ISegmentDb.go",
"repo_id": "chroma",
"token_count": 1146
} | 50 |
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export function bpeDecoder(suffix?: string | undefined | null): Decoder
export function byteFallbackDecoder(): Decoder
export function ctcDecoder(
padToken?: string = '<pad>',
wordDelimiterToken?: string | undefined | null,
cleanup?: bool... | tokenizers/bindings/node/index.d.ts/0 | {
"file_path": "tokenizers/bindings/node/index.d.ts",
"repo_id": "tokenizers",
"token_count": 2717
} | 411 |
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/src/diffusers/loaders/peft.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/peft.py",
"repo_id": "diffusers",
"token_count": 3289
} | 237 |
import { CloudflareWorkersAI } from "@langchain/cloudflare";
const model = new CloudflareWorkersAI({
model: "@cf/meta/llama-2-7b-chat-int8", // Default value
cloudflareAccountId: process.env.CLOUDFLARE_ACCOUNT_ID,
cloudflareApiToken: process.env.CLOUDFLARE_API_TOKEN,
// Pass a custom base URL to use Cloudflare... | langchainjs/examples/src/models/llm/cloudflare_workersai.ts/0 | {
"file_path": "langchainjs/examples/src/models/llm/cloudflare_workersai.ts",
"repo_id": "langchainjs",
"token_count": 528
} | 829 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
_PROMPT_TEMPLATE = """Translate a math problem into a expression that can be executed using Python's numexpr library. Use the output of running this code to answer the question.
Question: ${{Question with math problem.}}
```text
${{single line ma... | langchain/libs/langchain/langchain/chains/llm_math/prompt.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/llm_math/prompt.py",
"repo_id": "langchain",
"token_count": 310
} | 492 |
package model
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/proto/etcdpb"
)
func TestAlias_Available(t *testing.T) {
type fields struct {
Name string
CollectionID int64
CreatedTime uint64
State etcdpb.AliasState
}
tests := []struct {
na... | milvus/internal/metastore/model/alias_test.go/0 | {
"file_path": "milvus/internal/metastore/model/alias_test.go",
"repo_id": "milvus",
"token_count": 889
} | 1,827 |
"""Test query bundle."""
from typing import Dict, List
import pytest
from llama_index.legacy.embeddings.base import BaseEmbedding
from llama_index.legacy.indices.list.base import SummaryIndex
from llama_index.legacy.schema import Document, QueryBundle
from llama_index.legacy.service_context import ServiceContext
@p... | llama_index/llama-index-legacy/tests/indices/query/test_query_bundle.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/indices/query/test_query_bundle.py",
"repo_id": "llama_index",
"token_count": 1459
} | 1,621 |
"""Sentence Transformer Finetuning Engine."""
import logging
from typing import Any, List, Optional, Tuple, Type, cast
from llama_index.legacy.embeddings.adapter import AdapterEmbeddingModel
from llama_index.legacy.embeddings.base import BaseEmbedding
from llama_index.legacy.finetuning.embeddings.common import Embedd... | llama_index/llama-index-legacy/llama_index/legacy/finetuning/embeddings/adapter.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/embeddings/adapter.py",
"repo_id": "llama_index",
"token_count": 2752
} | 1,708 |
# coding=utf-8
# Copyright 2021 Google Research and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | transformers/src/transformers/models/big_bird/tokenization_big_bird.py/0 | {
"file_path": "transformers/src/transformers/models/big_bird/tokenization_big_bird.py",
"repo_id": "transformers",
"token_count": 6494
} | 638 |
from io import BytesIO
from typing import List, Union
import requests
from ..utils import add_end_docstrings, is_decord_available, is_torch_available, logging, requires_backends
from .base import Pipeline, build_pipeline_init_args
if is_decord_available():
import numpy as np
from decord import VideoReader
... | transformers/src/transformers/pipelines/video_classification.py/0 | {
"file_path": "transformers/src/transformers/pipelines/video_classification.py",
"repo_id": "transformers",
"token_count": 1985
} | 684 |
# flake8: noqa
JIRA_ISSUE_CREATE_PROMPT = """
This tool is a wrapper around atlassian-python-api's Jira issue_create API, useful when you need to create a Jira issue.
The input to this tool is a dictionary specifying the fields of the Jira issue, and will be passed into atlassian-python-api's Jira `issue_creat... | langchain/libs/community/langchain_community/tools/jira/prompt.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/jira/prompt.py",
"repo_id": "langchain",
"token_count": 939
} | 300 |
import logging
import time
import pytest
import random
import numpy as np
from pathlib import Path
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.milvus_sys import MilvusSys
from common.common_type import CaseLabel, CheckTasks
from utils.u... | milvus/tests/python_client/bulk_insert/test_bulk_insert_api.py/0 | {
"file_path": "milvus/tests/python_client/bulk_insert/test_bulk_insert_api.py",
"repo_id": "milvus",
"token_count": 51454
} | 1,891 |
# Iterative Trainer
Iterative fine-tuning is a training method that enables to perform custom actions (generation and filtering for example) between optimization steps. In TRL we provide an easy-to-use API to fine-tune your models in an iterative way in just a few lines of code.
## Usage
To get started quickly, inst... | trl/docs/source/iterative_sft_trainer.mdx/0 | {
"file_path": "trl/docs/source/iterative_sft_trainer.mdx",
"repo_id": "trl",
"token_count": 389
} | 854 |
import gc
import unittest
import numpy as np
import torch
from torch.backends.cuda import sdp_kernel
from diffusers import (
CMStochasticIterativeScheduler,
ConsistencyModelPipeline,
UNet2DModel,
)
from diffusers.utils.testing_utils import (
enable_full_determinism,
nightly,
require_torch_2,
... | diffusers/tests/pipelines/consistency_models/test_consistency_models.py/0 | {
"file_path": "diffusers/tests/pipelines/consistency_models/test_consistency_models.py",
"repo_id": "diffusers",
"token_count": 4999
} | 275 |
# retrieval-agent
This package uses Azure OpenAI to do retrieval using an agent architecture.
By default, this does retrieval over Arxiv.
## Environment Setup
Since we are using Azure OpenAI, we will need to set the following environment variables:
```shell
export AZURE_OPENAI_ENDPOINT=...
export AZURE_OPENAI_API_V... | langchain/templates/retrieval-agent/README.md/0 | {
"file_path": "langchain/templates/retrieval-agent/README.md",
"repo_id": "langchain",
"token_count": 629
} | 675 |
# Designing Multi-Agents systems
For this section, you're going to watch this excellent introduction to multi-agents made by <a href="https://www.youtube.com/channel/UCq0imsn84ShAe9PBOFnoIrg"> Brian Douglas </a>.
<Youtube id="qgb0gyrpiGk" />
In this video, Brian talked about how to design multi-agent systems. He sp... | deep-rl-class/units/en/unit7/multi-agent-setting.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit7/multi-agent-setting.mdx",
"repo_id": "deep-rl-class",
"token_count": 847
} | 158 |
"""init.py."""
from llama_index.tools.chatgpt_plugin.base import (
ChatGPTPluginToolSpec,
)
__all__ = ["ChatGPTPluginToolSpec"]
| llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/__init__.py",
"repo_id": "llama_index",
"token_count": 52
} | 1,477 |
import fs from "fs";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { test, expect } from "@jest/globals";
import { Document } from "@langchain/core/documents";
import { FaissStore } from "@langchain/community/vectorstores/faiss";
import { GoogleVertexAIMultimodalEmbeddings } from "... | langchainjs/langchain/src/experimental/multimodal_embeddings/tests/googlevertexai.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/multimodal_embeddings/tests/googlevertexai.int.test.ts",
"repo_id": "langchainjs",
"token_count": 860
} | 924 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/esm/convert_esm.py/0 | {
"file_path": "transformers/src/transformers/models/esm/convert_esm.py",
"repo_id": "transformers",
"token_count": 8133
} | 668 |
"""Slack tools."""
from langchain_community.tools.slack.get_channel import SlackGetChannel
from langchain_community.tools.slack.get_message import SlackGetMessage
from langchain_community.tools.slack.schedule_message import SlackScheduleMessage
from langchain_community.tools.slack.send_message import SlackSendMessage
... | langchain/libs/community/langchain_community/tools/slack/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/slack/__init__.py",
"repo_id": "langchain",
"token_count": 158
} | 311 |
from typing import TYPE_CHECKING
from langchain_community.document_loaders.parsers.language.tree_sitter_segmenter import ( # noqa: E501
TreeSitterSegmenter,
)
if TYPE_CHECKING:
from tree_sitter import Language
CHUNK_QUERY = """
[
(class_definition) @class
(function_definition) @function... | langchain/libs/community/langchain_community/document_loaders/parsers/language/scala.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/scala.py",
"repo_id": "langchain",
"token_count": 308
} | 258 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 563,
"logprob": null,
"text": "def"
},
{
"id": 942,
"logprob": -5.1367188,
"text": " print"
},
{
"id":... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_santacoder/test_flash_santacoder.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_santacoder/test_flash_santacoder.json",
"repo_id": "text-generation-inference",
"token_count": 1111
} | 422 |
"""Retriever OpenAI agent."""
from typing import Any, cast
from llama_index.agent.openai_legacy.openai_agent import (
OpenAIAgent,
)
from llama_index.core.objects.base import ObjectRetriever
from llama_index.core.tools.types import BaseTool
class FnRetrieverOpenAIAgent(OpenAIAgent):
"""Function Retriever Op... | llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/llama_index/agent/openai_legacy/retriever_openai_agent.py/0 | {
"file_path": "llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/llama_index/agent/openai_legacy/retriever_openai_agent.py",
"repo_id": "llama_index",
"token_count": 329
} | 1,240 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querycoordv2/observers/resource_observer_test.go/0 | {
"file_path": "milvus/internal/querycoordv2/observers/resource_observer_test.go",
"repo_id": "milvus",
"token_count": 2861
} | 1,898 |
#!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. 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... | milvus/internal/core/build-support/cpplint.py/0 | {
"file_path": "milvus/internal/core/build-support/cpplint.py",
"repo_id": "milvus",
"token_count": 99937
} | 1,728 |
from typing import List
from langchain_community.document_loaders.unstructured import UnstructuredFileLoader
class UnstructuredMarkdownLoader(UnstructuredFileLoader):
"""Load `Markdown` files using `Unstructured`.
You can run the loader in one of two modes: "single" and "elements".
If you use "single" m... | langchain/libs/community/langchain_community/document_loaders/markdown.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/markdown.py",
"repo_id": "langchain",
"token_count": 638
} | 240 |
<jupyter_start><jupyter_text>Weaviate Reader<jupyter_code>%pip install llama-index-readers-weaviate
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))<jupyter_output><empty_output><jupyter_text>If you're opening ... | llama_index/docs/examples/data_connectors/WeaviateDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/data_connectors/WeaviateDemo.ipynb",
"repo_id": "llama_index",
"token_count": 751
} | 1,177 |
Documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The node API has not been documented yet.
| tokenizers/docs/source/api/node.inc/0 | {
"file_path": "tokenizers/docs/source/api/node.inc",
"repo_id": "tokenizers",
"token_count": 22
} | 446 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/util/grpcclient/errors.go/0 | {
"file_path": "milvus/internal/util/grpcclient/errors.go",
"repo_id": "milvus",
"token_count": 437
} | 1,897 |
from langchain_community.utilities.serpapi import HiddenPrints, SerpAPIWrapper
__all__ = ["HiddenPrints", "SerpAPIWrapper"]
| langchain/libs/langchain/langchain/utilities/serpapi.py/0 | {
"file_path": "langchain/libs/langchain/langchain/utilities/serpapi.py",
"repo_id": "langchain",
"token_count": 41
} | 598 |
# Required Environment Variables: OPENAI_API_KEY
from pathlib import Path
from llama_index.core import download_loader
from llama_index.core.llama_pack import download_llama_pack
from llama_index.llms.openai import OpenAI
# download and install dependencies
RAGFusionPipelinePack = download_llama_pack(
"RAGFusionP... | llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/examples/example.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/examples/example.py",
"repo_id": "llama_index",
"token_count": 243
} | 1,809 |
"""DEPRECATED: Kept for backwards compatibility."""
from langchain_core.utils.input import (
get_bolded_text,
get_color_mapping,
get_colored_text,
print_text,
)
__all__ = [
"get_bolded_text",
"get_color_mapping",
"get_colored_text",
"print_text",
]
| langchain/libs/langchain/langchain/input.py/0 | {
"file_path": "langchain/libs/langchain/langchain/input.py",
"repo_id": "langchain",
"token_count": 120
} | 516 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/cmd/roles/roles_test.go/0 | {
"file_path": "milvus/cmd/roles/roles_test.go",
"repo_id": "milvus",
"token_count": 989
} | 1,628 |
"""Logic for converting internal query language to a valid Chroma query."""
from typing import Tuple, Union
from langchain.chains.query_constructor.ir import (
Comparator,
Comparison,
Operation,
Operator,
StructuredQuery,
Visitor,
)
COMPARATOR_TO_TQL = {
Comparator.EQ: "==",
Comparator... | langchain/libs/langchain/langchain/retrievers/self_query/deeplake.py/0 | {
"file_path": "langchain/libs/langchain/langchain/retrievers/self_query/deeplake.py",
"repo_id": "langchain",
"token_count": 1120
} | 535 |
import { Document } from "@langchain/core/documents";
import {
RecursiveCharacterTextSplitter,
TextSplitter,
} from "../text_splitter.js";
/**
* Interface that defines the methods for loading and splitting documents.
*/
export interface DocumentLoader {
load(): Promise<Document[]>;
loadAndSplit(textSplitter?... | langchainjs/langchain/src/document_loaders/base.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/base.ts",
"repo_id": "langchainjs",
"token_count": 356
} | 916 |
from __future__ import annotations
from typing import Any, List
from langchain_core.output_parsers import BaseOutputParser
from langchain_core.output_parsers.json import parse_and_check_json_markdown
from langchain_core.pydantic_v1 import BaseModel
from langchain.output_parsers.format_instructions import (
STRUC... | langchain/libs/langchain/langchain/output_parsers/structured.py/0 | {
"file_path": "langchain/libs/langchain/langchain/output_parsers/structured.py",
"repo_id": "langchain",
"token_count": 1322
} | 553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.