text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
"""Test Chroma functionality."""
import uuid
import pytest
import requests
from langchain_core.documents import Document
from langchain_community.embeddings import FakeEmbeddings as Fak
from langchain_community.vectorstores import Chroma
from tests.integration_tests.vectorstores.fake_embeddings import (
Consisten... | langchain/libs/community/tests/integration_tests/vectorstores/test_chroma.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_chroma.py",
"repo_id": "langchain",
"token_count": 5507
} | 354 |
# Copyright 2020 The HuggingFace Datasets Authors.
#
# 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 ... | datasets/metrics/sacrebleu/sacrebleu.py/0 | {
"file_path": "datasets/metrics/sacrebleu/sacrebleu.py",
"repo_id": "datasets",
"token_count": 3057
} | 124 |
// 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/components/query_node.go/0 | {
"file_path": "milvus/cmd/components/query_node.go",
"repo_id": "milvus",
"token_count": 757
} | 1,751 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/models/unets/test_models_unet_spatiotemporal.py/0 | {
"file_path": "diffusers/tests/models/unets/test_models_unet_spatiotemporal.py",
"repo_id": "diffusers",
"token_count": 4294
} | 285 |
from typing import Dict, Tuple, Union
from langchain.chains.query_constructor.ir import (
Comparator,
Comparison,
Operation,
Operator,
StructuredQuery,
Visitor,
)
class PineconeTranslator(Visitor):
"""Translate `Pinecone` internal query language elements to valid filters."""
allowed_... | langchain/libs/langchain/langchain/retrievers/self_query/pinecone.py/0 | {
"file_path": "langchain/libs/langchain/langchain/retrievers/self_query/pinecone.py",
"repo_id": "langchain",
"token_count": 712
} | 534 |
# Exit immediately for non zero status
set -e
release=${1:-"milvus-chaos"}
ns=${2:-"chaos-testing"}
helm uninstall ${release} -n=${ns}
kubectl delete pvc -l release=${release} -n=${ns}
kubectl delete pvc -l app.kubernetes.io/instance=${release} -n=${ns}
| milvus/tests/python_client/chaos/scripts/uninstall_milvus.sh/0 | {
"file_path": "milvus/tests/python_client/chaos/scripts/uninstall_milvus.sh",
"repo_id": "milvus",
"token_count": 102
} | 2,173 |
// 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/datanode/l0_compactor.go/0 | {
"file_path": "milvus/internal/datanode/l0_compactor.go",
"repo_id": "milvus",
"token_count": 4645
} | 1,777 |
# Copyright 2020 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... | transformers/src/transformers/hf_argparser.py/0 | {
"file_path": "transformers/src/transformers/hf_argparser.py",
"repo_id": "transformers",
"token_count": 8210
} | 609 |
# coding=utf-8
# Copyright 2022 Microsoft 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/L... | transformers/src/transformers/models/cvt/modeling_cvt.py/0 | {
"file_path": "transformers/src/transformers/models/cvt/modeling_cvt.py",
"repo_id": "transformers",
"token_count": 12594
} | 652 |
# Copyright 2024 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 required by appl... | transformers/src/transformers/quantizers/quantizer_bnb_4bit.py/0 | {
"file_path": "transformers/src/transformers/quantizers/quantizer_bnb_4bit.py",
"repo_id": "transformers",
"token_count": 6085
} | 710 |
# coding=utf-8
# Copyright 2021 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/nystromformer/test_modeling_nystromformer.py/0 | {
"file_path": "transformers/tests/models/nystromformer/test_modeling_nystromformer.py",
"repo_id": "transformers",
"token_count": 5750
} | 725 |
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
name: test-datacoord-pod-kill
namespace: chaos-testing
spec:
schedule: '*/5 * * * * *'
startingDeadlineSeconds: 60
concurrencyPolicy: Forbid
historyLimit: 1
type: PodChaos
podChaos:
selector:
namespaces:
- chaos-testing
... | milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_datacoord_pod_kill.yaml/0 | {
"file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_datacoord_pod_kill.yaml",
"repo_id": "milvus",
"token_count": 224
} | 1,889 |
# 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/src/transformers/models/speecht5/convert_hifigan.py/0 | {
"file_path": "transformers/src/transformers/models/speecht5/convert_hifigan.py",
"repo_id": "transformers",
"token_count": 1706
} | 696 |
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.codespell]
check-filenames = true
check-hidden = true
skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
[tool.llamahub]
classes = ["IMDBReviews"]
contains_example = false
import_path = "llama_index.readers.imdb_review"
[... | llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/pyproject.toml",
"repo_id": "llama_index",
"token_count": 704
} | 1,461 |
use serde::{Deserialize, Serialize};
use crate::tokenizer::{PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior};
use crate::utils::macro_rules_attribute;
#[derive(Clone, Debug, PartialEq, Eq)]
/// Pre tokenizes the numbers into single tokens. If individual_digits is set
/// to true, then all digits are ... | tokenizers/tokenizers/src/pre_tokenizers/digits.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/digits.rs",
"repo_id": "tokenizers",
"token_count": 1667
} | 433 |
# candle-convnext
[A ConvNet for the 2020s](https://arxiv.org/abs/2201.03545) and
[ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders](https://arxiv.org/abs/2301.00808).
This candle implementation uses a pre-trained ConvNeXt network for inference. The
classification head has been trained on the I... | candle/candle-examples/examples/convnext/README.md/0 | {
"file_path": "candle/candle-examples/examples/convnext/README.md",
"repo_id": "candle",
"token_count": 293
} | 43 |
ignoreGeneratedHeader = false
severity = "error"
confidence = 0.8
errorCode = 1
warningCode = 0
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
[rule.if-return]
[rule.increment-decrement]
[rule.var-... | milvus/tools/check/revive.toml/0 | {
"file_path": "milvus/tools/check/revive.toml",
"repo_id": "milvus",
"token_count": 250
} | 1,916 |
from typing import Any, Dict, Type
from llama_index.core.readers.base import BasePydanticReader
from llama_index.core.readers.string_iterable import StringIterableReader
ALL_READERS: Dict[str, Type[BasePydanticReader]] = {
StringIterableReader.class_name(): StringIterableReader,
}
def load_reader(data: Dict[str... | llama_index/llama-index-core/llama_index/core/readers/loading.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/readers/loading.py",
"repo_id": "llama_index",
"token_count": 276
} | 1,139 |
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
All... | milvus/internal/core/thirdparty/NamedType/.clang-format/0 | {
"file_path": "milvus/internal/core/thirdparty/NamedType/.clang-format",
"repo_id": "milvus",
"token_count": 1108
} | 1,897 |
---
sidebar_position: 2
---
# Agent Types
This categorizes all the available agents along a few dimensions.
**Intended Model Type**
Whether this agent is intended for Chat Models (takes in messages, outputs message) or LLMs (takes in string, outputs string).
The main thing this affects is the prompting strategy use... | langchainjs/docs/core_docs/docs/modules/agents/agent_types/index.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/agents/agent_types/index.mdx",
"repo_id": "langchainjs",
"token_count": 1934
} | 722 |
/* eslint-disable import/first */
/* eslint-disable arrow-body-style */
/* eslint-disable import/no-duplicates */
import { v4 as uuidv4 } from "uuid";
const uniqueId = uuidv4().slice(0, 8);
import { Client } from "langsmith";
const client = new Client();
import { AgentExecutor, createOpenAIFunctionsAgent } from "la... | langchainjs/examples/src/guides/langsmith/eval_walkthrough.ts/0 | {
"file_path": "langchainjs/examples/src/guides/langsmith/eval_walkthrough.ts",
"repo_id": "langchainjs",
"token_count": 1226
} | 781 |
"""Test the telegram chat loader."""
import pathlib
import tempfile
import zipfile
from typing import Sequence
import pytest
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
from langchain_community.chat_loaders import telegram, utils
def _assert_messages_are_equal(
actual_messages: Sequ... | langchain/libs/community/tests/unit_tests/chat_loaders/test_telegram.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/chat_loaders/test_telegram.py",
"repo_id": "langchain",
"token_count": 1602
} | 361 |
export function deepCompareStrict(a: any, b: any): boolean {
const typeofa = typeof a;
if (typeofa !== typeof b) {
return false;
}
if (Array.isArray(a)) {
if (!Array.isArray(b)) {
return false;
}
const length = a.length;
if (length !== b.length) {
return false;
}
for (let... | langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/deep-compare-strict.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/deep-compare-strict.ts",
"repo_id": "langchainjs",
"token_count": 393
} | 872 |
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```from fastapi import FastAPIfrom langserve import add_routesfrom propositional_retrieval import chainapp = FastAPI( title="LangChain Server", version="1.0", description="Retriever and Generator for RAG Chroma Dense Retrieval",)add_routes(app, chai... | langchain/templates/propositional-retrieval/propositional_retrieval.ipynb/0 | {
"file_path": "langchain/templates/propositional-retrieval/propositional_retrieval.ipynb",
"repo_id": "langchain",
"token_count": 234
} | 671 |
{
"name": "Milvus Distributed Dev Container Definition",
"dockerComposeFile": ["./docker-compose-devcontainer.yml"],
"service": "builder",
"initializeCommand": "scripts/devcontainer.sh",
"workspaceFolder": "/go/src/github.com/milvus-io/milvus",
"remoteEnv": { "GOPROXY": "https://goproxy.cn" },
... | milvus/.devcontainer.json/0 | {
"file_path": "milvus/.devcontainer.json",
"repo_id": "milvus",
"token_count": 168
} | 1,882 |
from langchain_community.document_loaders.base_o365 import (
O365BaseLoader,
)
__all__ = [
"O365BaseLoader",
]
| langchain/libs/langchain/langchain/document_loaders/base_o365.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/base_o365.py",
"repo_id": "langchain",
"token_count": 48
} | 485 |
<jupyter_start><jupyter_text>Guide: Using Vector Store Index with Existing Weaviate 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-weaviate
%pip install llama-index-embeddings-openai
!pip install llama-index
imp... | llama_index/docs/examples/vector_stores/existing_data/weaviate_existing_data.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/existing_data/weaviate_existing_data.ipynb",
"repo_id": "llama_index",
"token_count": 1595
} | 1,171 |
use crate::onnx;
use crate::onnx::attribute_proto::AttributeType;
use crate::onnx::tensor_proto::DataType;
use candle::{bail, DType, Device, Result, Tensor};
use std::collections::HashMap;
pub type Value = Tensor;
pub fn dtype(dt: DataType) -> Option<DType> {
match dt {
DataType::Uint8 => Some(DType::U8),... | candle/candle-onnx/src/eval.rs/0 | {
"file_path": "candle/candle-onnx/src/eval.rs",
"repo_id": "candle",
"token_count": 20779
} | 64 |
{
"endOfLine": "lf"
} | langsmith-sdk/js/.prettierrc/0 | {
"file_path": "langsmith-sdk/js/.prettierrc",
"repo_id": "langsmith-sdk",
"token_count": 15
} | 1,065 |
"""Test Google PaLM embeddings.
Note: This test must be run with the GOOGLE_API_KEY environment variable set to a
valid API key.
"""
from langchain_community.embeddings.google_palm import GooglePalmEmbeddings
def test_google_palm_embedding_documents() -> None:
"""Test Google PaLM embeddings."""
documen... | langchain/libs/community/tests/integration_tests/embeddings/test_google_palm.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_google_palm.py",
"repo_id": "langchain",
"token_count": 381
} | 348 |
import unittest
import pytest
from langchain_community.document_loaders.parsers.language.cpp import CPPSegmenter
@pytest.mark.requires("tree_sitter", "tree_sitter_languages")
class TestCPPSegmenter(unittest.TestCase):
def setUp(self) -> None:
self.example_code = """int foo() {
return 1;
}
class T {... | langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_cpp.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_cpp.py",
"repo_id": "langchain",
"token_count": 722
} | 402 |
<jupyter_start><jupyter_text>**Stable Diffusion** 🎨 *...using `🧨diffusers`*Stable Diffusion is a text-to-image latent diffusion model created by the researchers and engineers from [CompVis](https://github.com/CompVis), [Stability AI](https://stability.ai/) and [LAION](https://laion.ai/). It's trained on 512x512 image... | notebooks/diffusers/stable_diffusion.ipynb/0 | {
"file_path": "notebooks/diffusers/stable_diffusion.ipynb",
"repo_id": "notebooks",
"token_count": 7373
} | 315 |
from typing import Iterator, List
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
class OpenCityDataLoader(BaseLoader):
"""Load from `Open City`."""
def __init__(self, city_id: str, dataset_id: str, limit: int):
"""Initialize with datas... | langchain/libs/community/langchain_community/document_loaders/open_city_data.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/open_city_data.py",
"repo_id": "langchain",
"token_count": 607
} | 261 |
import asyncio
from functools import partial
from typing import (
Any,
List,
Optional,
)
from ai21.models import CompletionsResponse, Penalty
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain_core.language_models import BaseLLM
from lan... | langchain/libs/partners/ai21/langchain_ai21/llms.py/0 | {
"file_path": "langchain/libs/partners/ai21/langchain_ai21/llms.py",
"repo_id": "langchain",
"token_count": 1827
} | 638 |
import pytest
from tokenizers import Tokenizer, decoders, models, normalizers, pre_tokenizers, processors
from tokenizers.implementations import BaseTokenizer
class TestBaseTokenizer:
def test_get_set_components(self):
toki = Tokenizer(models.BPE())
toki.normalizer = normalizers.NFC()
tok... | tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py/0 | {
"file_path": "tokenizers/bindings/python/tests/implementations/test_base_tokenizer.py",
"repo_id": "tokenizers",
"token_count": 555
} | 427 |
import { ChatOpenAI } from "@langchain/openai";
import { PromptTemplate } from "@langchain/core/prompts";
const prompt = PromptTemplate.fromTemplate(`Tell me a joke about {subject}`);
const model = new ChatOpenAI({});
const functionSchema = [
{
name: "joke",
description: "A joke",
parameters: {
t... | langchainjs/examples/src/guides/expression_language/cookbook_function_call.ts/0 | {
"file_path": "langchainjs/examples/src/guides/expression_language/cookbook_function_call.ts",
"repo_id": "langchainjs",
"token_count": 451
} | 776 |
import json
import re
from datetime import datetime
from typing import List
import requests
from tenacity import retry, stop_after_attempt, wait_random_exponential
def correct_date(yr, dt):
"""Some transcripts have incorrect date, correcting it.
Args:
yr (int): actual
dt (datetime): given da... | llama_index/llama-index-integrations/readers/llama-index-readers-earnings-call-transcript/llama_index/readers/earnings_call_transcript/utils.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-earnings-call-transcript/llama_index/readers/earnings_call_transcript/utils.py",
"repo_id": "llama_index",
"token_count": 630
} | 1,428 |
# LlamaIndex Embeddings Integration: Gemini
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/README.md",
"repo_id": "llama_index",
"token_count": 11
} | 1,179 |
import asyncio
import importlib
from typing import Any, List, Optional
from langchain_experimental.comprehend_moderation.base_moderation_exceptions import (
ModerationToxicityError,
)
class ComprehendToxicity:
def __init__(
self,
client: Any,
callback: Optional[Any] = None,
un... | langchain/libs/experimental/langchain_experimental/comprehend_moderation/toxicity.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/comprehend_moderation/toxicity.py",
"repo_id": "langchain",
"token_count": 2832
} | 458 |
<jupyter_start><jupyter_text>Microsoft Word>[Microsoft Word](https://www.microsoft.com/en-us/microsoft-365/word) is a word processor developed by Microsoft.This covers how to load `Word` documents into a document format that we can use downstream. Using Docx2txtLoad .docx using `Docx2txt` into a document.<jupyter_code... | langchain/docs/docs/integrations/document_loaders/microsoft_word.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/microsoft_word.ipynb",
"repo_id": "langchain",
"token_count": 347
} | 116 |
import { type SerializedFields, keyToJson, mapKeys } from "./map_keys.js";
export interface BaseSerialized<T extends string> {
lc: number;
type: T;
id: string[];
}
export interface SerializedConstructor extends BaseSerialized<"constructor"> {
kwargs: SerializedFields;
}
export interface SerializedSecret exte... | langchainjs/langchain-core/src/load/serializable.ts/0 | {
"file_path": "langchainjs/langchain-core/src/load/serializable.ts",
"repo_id": "langchainjs",
"token_count": 2522
} | 897 |
# 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/maskformer/convert_maskformer_swin_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/maskformer/convert_maskformer_swin_to_pytorch.py",
"repo_id": "transformers",
"token_count": 8473
} | 711 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SnapShotKV is an autogenerated mock type for the SnapShotKV type
type SnapShotKV struct {
mock.Mock
}
type SnapShotKV_Expecter struct {
mock *mock.Mock
}
func (_m *SnapShotKV) EXPECT() *SnapShotKV_E... | milvus/internal/kv/mocks/snapshot_kv.go/0 | {
"file_path": "milvus/internal/kv/mocks/snapshot_kv.go",
"repo_id": "milvus",
"token_count": 3311
} | 1,823 |
from llama_index.packs.stock_market_data_query_engine.base import (
StockMarketDataQueryEnginePack,
)
__all__ = ["StockMarketDataQueryEnginePack"]
| llama_index/llama-index-packs/llama-index-packs-stock-market-data-query-engine/llama_index/packs/stock_market_data_query_engine/__init__.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-stock-market-data-query-engine/llama_index/packs/stock_market_data_query_engine/__init__.py",
"repo_id": "llama_index",
"token_count": 49
} | 1,679 |
# coding=utf-8
# Copyright 2020-present Google Brain and Carnegie Mellon University 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.a... | transformers/src/transformers/models/funnel/modeling_funnel.py/0 | {
"file_path": "transformers/src/transformers/models/funnel/modeling_funnel.py",
"repo_id": "transformers",
"token_count": 30866
} | 674 |
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 = """
[
(function_declaration) @function
(type_declaration) @type... | langchain/libs/community/langchain_community/document_loaders/parsers/language/go.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/go.py",
"repo_id": "langchain",
"token_count": 277
} | 263 |
""" PyTorch Feature Extraction Helpers
A collection of classes, functions, modules to help extract features from models
and provide a common interface for describing them.
The return_layers, module re-writing idea inspired by torchvision IntermediateLayerGetter
https://github.com/pytorch/vision/blob/d88d8961ae51507d0... | pytorch-image-models/timm/models/_features.py/0 | {
"file_path": "pytorch-image-models/timm/models/_features.py",
"repo_id": "pytorch-image-models",
"token_count": 6555
} | 398 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# 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 ag... | diffusers/tests/pipelines/kandinsky3/test_kandinsky3_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky3/test_kandinsky3_img2img.py",
"repo_id": "diffusers",
"token_count": 3405
} | 287 |
<jupyter_start><jupyter_text>File SystemLangChain provides tools for interacting with a local file system out of the box. This notebook walks through some of them.**Note:** these tools are not recommended for use outside a sandboxed environment! First, we'll import the tools.<jupyter_code>from tempfile import Temporar... | langchain/docs/docs/integrations/tools/filesystem.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/filesystem.ipynb",
"repo_id": "langchain",
"token_count": 476
} | 173 |
# 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/audio_spectrogram_transformer/convert_audio_spectrogram_transformer_original_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/audio_spectrogram_transformer/convert_audio_spectrogram_transformer_original_to_pytorch.py",
"repo_id": "transformers",
"token_count": 4992
} | 563 |
// 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/datacoord/channel_store_test.go/0 | {
"file_path": "milvus/internal/datacoord/channel_store_test.go",
"repo_id": "milvus",
"token_count": 2077
} | 1,683 |
from __future__ import annotations
import logging
from typing import Optional
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_community.tools.edenai.edenai_base_tool import EdenaiTool
logger = logging.getLogger(__name__)
class EdenAiParsingIDTool(EdenaiTool):
"""Tool that queries... | langchain/libs/community/langchain_community/tools/edenai/ocr_identityparser.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/edenai/ocr_identityparser.py",
"repo_id": "langchain",
"token_count": 812
} | 300 |
export const DEFAULT_PREFIX = `Assistant is a large language model trained by OpenAI.
Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate h... | langchainjs/langchain/src/agents/chat_convo/prompt.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/chat_convo/prompt.ts",
"repo_id": "langchainjs",
"token_count": 789
} | 849 |
import { assert, it, describe, afterEach, vi, expect } from "vitest";
import type { Cookies } from "@sveltejs/kit";
import { collections } from "$lib/server/database";
import { updateUser } from "./updateUser";
import { ObjectId } from "mongodb";
import { DEFAULT_SETTINGS } from "$lib/types/Settings";
import { defaultM... | chat-ui/src/routes/login/callback/updateUser.spec.ts/0 | {
"file_path": "chat-ui/src/routes/login/callback/updateUser.spec.ts",
"repo_id": "chat-ui",
"token_count": 1408
} | 114 |
<!--Copyright 2021 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... | transformers/docs/source/en/model_doc/fnet.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/fnet.md",
"repo_id": "transformers",
"token_count": 1150
} | 454 |
from langchain_community.chat_loaders.telegram import TelegramChatLoader
__all__ = ["TelegramChatLoader"]
| langchain/libs/langchain/langchain/chat_loaders/telegram.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chat_loaders/telegram.py",
"repo_id": "langchain",
"token_count": 30
} | 515 |
# coding=utf-8
# Copyright 2021 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/unispeech_sat/test_modeling_unispeech_sat.py/0 | {
"file_path": "transformers/tests/models/unispeech_sat/test_modeling_unispeech_sat.py",
"repo_id": "transformers",
"token_count": 17114
} | 740 |
from typing import Dict, Type
from llama_index.legacy.llms.bedrock import Bedrock
from llama_index.legacy.llms.custom import CustomLLM
from llama_index.legacy.llms.gradient import (
GradientBaseModelLLM,
GradientModelAdapterLLM,
)
from llama_index.legacy.llms.huggingface import HuggingFaceLLM
from llama_index.... | llama_index/llama-index-legacy/llama_index/legacy/llms/loading.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/loading.py",
"repo_id": "llama_index",
"token_count": 735
} | 1,578 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
export * from "@langchain/core/utils/testing";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "embeddings/fake",
newEntrypointName: "utils/testing",
newPackageName: "@langchain/core",
});
| langchainjs/langchain/src/embeddings/fake.ts/0 | {
"file_path": "langchainjs/langchain/src/embeddings/fake.ts",
"repo_id": "langchainjs",
"token_count": 95
} | 951 |
<!--Copyright 2020 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... | transformers/docs/source/es/serialization.md/0 | {
"file_path": "transformers/docs/source/es/serialization.md",
"repo_id": "transformers",
"token_count": 10461
} | 480 |
package storage
import (
"fmt"
"strconv"
"strings"
"github.com/milvus-io/milvus/pkg/common"
)
// ParseSegmentIDByBinlog parse segment id from binlog paths
// if path format is not expected, returns error
func ParseSegmentIDByBinlog(rootPath, path string) (UniqueID, error) {
// check path contains rootPath as pr... | milvus/internal/storage/binlog_util.go/0 | {
"file_path": "milvus/internal/storage/binlog_util.go",
"repo_id": "milvus",
"token_count": 412
} | 2,062 |
"""
Develop installable templates.
"""
import re
import shutil
import subprocess
from pathlib import Path
from typing import Optional
import typer
from typing_extensions import Annotated
from langchain_cli.utils.packages import get_langserve_export, get_package_root
package_cli = typer.Typer(no_args_is_help=True, a... | langchain/libs/cli/langchain_cli/namespaces/template.py/0 | {
"file_path": "langchain/libs/cli/langchain_cli/namespaces/template.py",
"repo_id": "langchain",
"token_count": 1622
} | 206 |
from langchain_community.vectorstores.vearch import Vearch
__all__ = ["Vearch"]
| langchain/libs/langchain/langchain/vectorstores/vearch.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/vearch.py",
"repo_id": "langchain",
"token_count": 25
} | 608 |
<jupyter_start><jupyter_text>LlamaEdge[LlamaEdge](https://github.com/second-state/LlamaEdge) allows you to chat with LLMs of [GGUF](https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/README.md) format both locally and via chat service.- `LlamaEdgeChatService` provides developers an OpenAI API compatible service... | langchain/docs/docs/integrations/chat/llama_edge.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/chat/llama_edge.ipynb",
"repo_id": "langchain",
"token_count": 759
} | 101 |
from llama_index.readers.airbyte_stripe.base import AirbyteStripeReader
__all__ = ["AirbyteStripeReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/llama_index/readers/airbyte_stripe/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/llama_index/readers/airbyte_stripe/__init__.py",
"repo_id": "llama_index",
"token_count": 38
} | 1,328 |
<jupyter_start><jupyter_text>Yellowbrick[Yellowbrick](https://yellowbrick.com/yellowbrick-data-warehouse/) is an elastic, massively parallel processing (MPP) SQL database that runs in the cloud and on-premises, using kubernetes for scale, resilience and cloud portability. Yellowbrick is designed to address the largest ... | langchain/docs/docs/integrations/vectorstores/yellowbrick.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/yellowbrick.ipynb",
"repo_id": "langchain",
"token_count": 3258
} | 194 |
import { LlamaModel, LlamaContext, LlamaChatSession } from "node-llama-cpp";
import {
LLM,
type BaseLLMCallOptions,
type BaseLLMParams,
} from "@langchain/core/language_models/llms";
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
import { GenerationChunk } from "@langchain/core/outp... | langchainjs/libs/langchain-community/src/llms/llama_cpp.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/llms/llama_cpp.ts",
"repo_id": "langchainjs",
"token_count": 1213
} | 972 |
use std::sync::Arc;
use tokio::select;
use crate::system::ComponentContext;
use super::{
sender::{Sender, Wrapper},
system::System,
Component,
};
struct Inner<C>
where
C: Component,
{
pub(super) sender: Sender<C>,
pub(super) cancellation_token: tokio_util::sync::CancellationToken,
pub(su... | chroma/rust/worker/src/system/executor.rs/0 | {
"file_path": "chroma/rust/worker/src/system/executor.rs",
"repo_id": "chroma",
"token_count": 1214
} | 64 |
# coding=utf-8
# Copyright 2022 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/mobilenet_v1/test_modeling_mobilenet_v1.py/0 | {
"file_path": "transformers/tests/models/mobilenet_v1/test_modeling_mobilenet_v1.py",
"repo_id": "transformers",
"token_count": 3818
} | 723 |
"""Question answering over a graph."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Optional
if TYPE_CHECKING:
import rdflib
from langchain_community.graphs import OntotextGraphDBGraph
from langchain_core.callbacks.manager import CallbackManager
from langchain_core.langua... | langchain/libs/langchain/langchain/chains/graph_qa/ontotext_graphdb.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/graph_qa/ontotext_graphdb.py",
"repo_id": "langchain",
"token_count": 3280
} | 482 |
# Copyright (c) 2022 Pablo Pernías MIT License
# Copyright 2024 UC Berkeley Team and 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://... | diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 3661
} | 257 |
---
hide_table_of_contents: true
---
# YouTube transcripts
This covers how to load youtube transcript into LangChain documents.
## Setup
You'll need to install the [youtube-transcript](https://www.npmjs.com/package/youtube-transcript) package
and [youtubei.js](https://www.npmjs.com/package/youtubei.js) to extract m... | langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/youtube.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/youtube.mdx",
"repo_id": "langchainjs",
"token_count": 236
} | 730 |
from langchain_community.document_loaders.slack_directory import SlackDirectoryLoader
__all__ = ["SlackDirectoryLoader"]
| langchain/libs/langchain/langchain/document_loaders/slack_directory.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/slack_directory.py",
"repo_id": "langchain",
"token_count": 32
} | 490 |
"""Tavily Search API toolkit."""
from langchain_community.tools.tavily_search.tool import (
TavilyAnswer,
TavilySearchResults,
)
__all__ = ["TavilySearchResults", "TavilyAnswer"]
| langchain/libs/community/langchain_community/tools/tavily_search/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/tavily_search/__init__.py",
"repo_id": "langchain",
"token_count": 68
} | 311 |
<jupyter_start><jupyter_text>OpenAI Agent with Query Engine Tools Build Query Engine Tools If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-agent-openai
!pip install llama-index
from llama_index.core import (
SimpleDirectoryReader,
... | llama_index/docs/examples/agent/openai_agent_with_query_engine.ipynb/0 | {
"file_path": "llama_index/docs/examples/agent/openai_agent_with_query_engine.ipynb",
"repo_id": "llama_index",
"token_count": 1305
} | 1,103 |
import asyncio
import json
import operator
from contextlib import asynccontextmanager, contextmanager
from typing import (
Annotated,
Any,
AsyncGenerator,
AsyncIterator,
Generator,
Optional,
TypedDict,
Union,
)
import pytest
from langchain_core.runnables import RunnablePassthrough
from ... | langgraph/tests/test_pregel_async.py/0 | {
"file_path": "langgraph/tests/test_pregel_async.py",
"repo_id": "langgraph",
"token_count": 23678
} | 1,021 |
from __future__ import annotations
from copy import deepcopy
from typing import List, Optional
from langchain_core.outputs.generation import Generation
from langchain_core.outputs.run_info import RunInfo
from langchain_core.pydantic_v1 import BaseModel
class LLMResult(BaseModel):
"""Class that contains all resu... | langchain/libs/core/langchain_core/outputs/llm_result.py/0 | {
"file_path": "langchain/libs/core/langchain_core/outputs/llm_result.py",
"repo_id": "langchain",
"token_count": 1094
} | 416 |
//! Types for elements that can be stored and manipulated using tensors.
#![allow(clippy::redundant_closure_call)]
use crate::backend::BackendStorage;
use crate::{CpuStorage, Error, Result};
/// The different types of elements allowed in tensors.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum DType {
... | candle/candle-core/src/dtype.rs/0 | {
"file_path": "candle/candle-core/src/dtype.rs",
"repo_id": "candle",
"token_count": 2875
} | 33 |
# flake8: noqa
NEWS_DOCS = """API documentation:
Endpoint: https://newsapi.org
Top headlines /v2/top-headlines
This endpoint provides live top and breaking headlines for a country, specific category in a country, single source, or multiple sources. You can also search with keywords. Articles are sorted by the earliest... | langchain/libs/langchain/langchain/chains/api/news_docs.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/api/news_docs.py",
"repo_id": "langchain",
"token_count": 632
} | 454 |
"use client";
import React, { useRef, useState } from "react";
import { useSearchParams } from "next/navigation";
import { v4 as uuidv4 } from "uuid";
import { RemoteRunnable } from "langchain/runnables/remote";
import { applyPatch } from "@langchain/core/utils/json_patch";
import { ChatMessageBubble, Message } from... | weblangchain/nextjs/app/components/ChatWindow.tsx/0 | {
"file_path": "weblangchain/nextjs/app/components/ChatWindow.tsx",
"repo_id": "weblangchain",
"token_count": 6352
} | 2,005 |
# Usage Pattern (Retrieval)
## Using `RetrieverEvaluator`
This runs evaluation over a single query + ground-truth document set given a retriever.
The standard practice is to specify a set of valid metrics with `from_metrics`.
```python
from llama_index.core.evaluation import RetrieverEvaluator
# define retriever s... | llama_index/docs/module_guides/evaluating/usage_pattern_retrieval.md/0 | {
"file_path": "llama_index/docs/module_guides/evaluating/usage_pattern_retrieval.md",
"repo_id": "llama_index",
"token_count": 474
} | 1,155 |
from typing import Annotated, Union
from langchain_core.messages import AnyMessage
from langgraph.graph.state import StateGraph
Messages = Union[list[AnyMessage], AnyMessage]
def add_messages(left: Messages, right: Messages) -> Messages:
if not isinstance(left, list):
left = [left]
if not isinstanc... | langgraph/langgraph/graph/message.py/0 | {
"file_path": "langgraph/langgraph/graph/message.py",
"repo_id": "langgraph",
"token_count": 216
} | 1,119 |
from llama_index.program.evaporate.base import BaseEvaporateProgram, DFEvaporateProgram
__all__ = ["BaseEvaporateProgram", "DFEvaporateProgram"]
| llama_index/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/program/llama-index-program-evaporate/llama_index/program/evaporate/__init__.py",
"repo_id": "llama_index",
"token_count": 47
} | 1,391 |
from __future__ import annotations
import base64
from abc import ABC, abstractmethod
from typing import (
TYPE_CHECKING,
Any,
Generic,
Iterator,
List,
Optional,
Sequence,
Tuple,
TypeVar,
)
from langchain_core.stores import BaseStore, ByteStore
from langchain_community.utilities.as... | langchain/libs/community/langchain_community/storage/astradb.py/0 | {
"file_path": "langchain/libs/community/langchain_community/storage/astradb.py",
"repo_id": "langchain",
"token_count": 1491
} | 289 |
import inspect
import os
import random
import warnings
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
from diffusers.image_processor imp... | diffusers/examples/community/pipeline_demofusion_sdxl.py/0 | {
"file_path": "diffusers/examples/community/pipeline_demofusion_sdxl.py",
"repo_id": "diffusers",
"token_count": 35210
} | 207 |
from langgraph.checkpoint.base import BaseCheckpointSaver, Checkpoint, CheckpointAt
from langgraph.checkpoint.memory import MemorySaver
__all__ = [
"Checkpoint",
"CheckpointAt",
"BaseCheckpointSaver",
"MemorySaver",
]
| langgraph/langgraph/checkpoint/__init__.py/0 | {
"file_path": "langgraph/langgraph/checkpoint/__init__.py",
"repo_id": "langgraph",
"token_count": 81
} | 1,118 |
# DataNode Flowgraph Recovery Design
update: 6.4.2021, by [Goose](https://github.com/XuanYang-cn)
update: 6.21.2021, by [Goose](https://github.com/XuanYang-cn)
## 1. Common Sense
A. One message stream to one vchannel, so there are one start and one end position in one message pack.
B. Only when DataNode flushes, Da... | milvus/docs/design_docs/20210604-datanode_flowgraph_recovery_design.md/0 | {
"file_path": "milvus/docs/design_docs/20210604-datanode_flowgraph_recovery_design.md",
"repo_id": "milvus",
"token_count": 804
} | 1,905 |
<!--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... | transformers/docs/source/en/deepspeed.md/0 | {
"file_path": "transformers/docs/source/en/deepspeed.md",
"repo_id": "transformers",
"token_count": 18736
} | 479 |
# GitBook
>[GitBook](https://docs.gitbook.com/) is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs.
## Installation and Setup
There isn't any special setup for it.
## Document Loader
See a [usage example](/docs/integrations/document_loaders/git... | langchain/docs/docs/integrations/providers/gitbook.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/gitbook.mdx",
"repo_id": "langchain",
"token_count": 107
} | 136 |
<jupyter_start><jupyter_text>Reddit Search In this notebook, we learn how the Reddit search tool works. First make sure that you have installed praw with the command below:<jupyter_code>%pip install --upgrade --quiet praw<jupyter_output><empty_output><jupyter_text>Then you need to set you need to set up the proper AP... | langchain/docs/docs/integrations/tools/reddit_search.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/reddit_search.ipynb",
"repo_id": "langchain",
"token_count": 1997
} | 176 |
import { test, expect } from "@jest/globals";
import { Matrix } from "ml-matrix";
import {
cosineSimilarity,
euclideanDistance,
innerProduct,
maximalMarginalRelevance,
normalize,
} from "../math.js";
test("Test cosine similarity zero", async () => {
const X = Matrix.rand(3, 3).to2DArray();
const Y = Matr... | langchainjs/langchain-core/src/utils/tests/math_utils.test.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/tests/math_utils.test.ts",
"repo_id": "langchainjs",
"token_count": 1936
} | 866 |
"""Loader that uses Selenium to load a page, then uses unstructured to load the html.
"""
import logging
from typing import TYPE_CHECKING, List, Literal, Optional, Union
if TYPE_CHECKING:
from selenium.webdriver import Chrome, Firefox
from langchain_core.documents import Document
from langchain_community.documen... | langchain/libs/community/langchain_community/document_loaders/url_selenium.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/url_selenium.py",
"repo_id": "langchain",
"token_count": 2895
} | 262 |
// 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/checkers/balance_checker.go/0 | {
"file_path": "milvus/internal/querycoordv2/checkers/balance_checker.go",
"repo_id": "milvus",
"token_count": 2155
} | 1,838 |
"""Test functionality related to length based selector."""
import pytest
from langchain_core.example_selectors import (
LengthBasedExampleSelector,
)
from langchain_core.prompts import PromptTemplate
EXAMPLES = [
{"question": "Question: who are you?\nAnswer: foo"},
{"question": "Question: who are you?\nAn... | langchain/libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py",
"repo_id": "langchain",
"token_count": 678
} | 403 |
[tool.poetry]
name = "rag-timescale-conversation"
version = "0.1.0"
description = "Conversational RAG using timescale-vector DB as retriver"
authors = [
"Lance Martin <lance@langchain.dev>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2"
tiktoken = ">=0.5... | langchain/templates/rag-timescale-conversation/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-timescale-conversation/pyproject.toml",
"repo_id": "langchain",
"token_count": 347
} | 686 |
import { expect, test } from "@jest/globals";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { loadPrompt } from "../load.js";
test("Load Hello World Prompt", async () => {
const helloWorld = path.join(
path.join(path.dirname(fileURLToPath(import.meta.url)), "prompts"),
"... | langchainjs/langchain/src/prompts/tests/load.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/prompts/tests/load.int.test.ts",
"repo_id": "langchainjs",
"token_count": 268
} | 1,007 |
python_tests()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-epsilla/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-epsilla/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,523 |
import * as uuid from "uuid";
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai";
import { MultiVectorRetriever } from "langchain/retrievers/multi_vector";
import { FaissStore } from "@langchain/community/vectorstores/faiss";
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";
impor... | langchainjs/examples/src/retrievers/multi_vector_hypothetical.ts/0 | {
"file_path": "langchainjs/examples/src/retrievers/multi_vector_hypothetical.ts",
"repo_id": "langchainjs",
"token_count": 1207
} | 821 |
# 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 required by appl... | transformers/src/transformers/models/nllb_moe/convert_nllb_moe_sharded_original_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/nllb_moe/convert_nllb_moe_sharded_original_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 2756
} | 707 |
import logging
import os
import re
import uuid
from typing import Dict, Generator, List, Union
import pandas as pd
import pytest
from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode
from llama_index.legacy.vector_stores import ElasticsearchStore
from llama_index.legacy.vector_stores.types ... | llama_index/llama-index-legacy/tests/vector_stores/test_elasticsearch.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_elasticsearch.py",
"repo_id": "llama_index",
"token_count": 7148
} | 1,548 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.