text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# coding=utf-8 # Copyright 2023 the Falcon 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://www.apache.org/licenses/LICE...
transformers/src/transformers/models/falcon/configuration_falcon.py/0
{ "file_path": "transformers/src/transformers/models/falcon/configuration_falcon.py", "repo_id": "transformers", "token_count": 3585 }
686
#/bin/sh # references: # https://github.com/opensearch-project/documentation-website/blob/2.10/assets/examples/docker-compose.yml # https://opensearch.org/docs/latest/security/configuration/disable/ cd opensearch docker build --tag=opensearch-dashboards-no-security -f opensearch-dashboards-no-security.Dockerfile ....
langchain/libs/community/tests/integration_tests/vectorstores/docker-compose/opensearch.sh/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/docker-compose/opensearch.sh", "repo_id": "langchain", "token_count": 124 }
374
import { OpenAI } from "@langchain/openai"; const model = new OpenAI( { temperature: 0 }, { baseURL: "https://oai.hconeai.com/v1" } ); const res = await model.call( "What would be a good company name a company that makes colorful socks?" ); console.log(res);
langchainjs/examples/src/models/llm/openai_basePath.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/openai_basePath.ts", "repo_id": "langchainjs", "token_count": 90 }
832
<!--Copyright 2023 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/ja/model_doc/clap.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/clap.md", "repo_id": "transformers", "token_count": 1775 }
541
from __future__ import annotations import logging from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Union, cast from langchain_core.chat_sessions import ChatSession from langchain_core.load.load import load from langchain_community.chat_loaders.base import BaseChatLoader if TYPE_CHECKING: ...
langchain/libs/community/langchain_community/chat_loaders/langsmith.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_loaders/langsmith.py", "repo_id": "langchain", "token_count": 2402 }
220
# 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/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py/0
{ "file_path": "transformers/src/transformers/models/mobilenet_v2/configuration_mobilenet_v2.py", "repo_id": "transformers", "token_count": 2748 }
695
# 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/mobilenet_v2/convert_original_tf_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/mobilenet_v2/convert_original_tf_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 2730 }
666
<!--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 applicable law or agreed...
transformers/docs/source/pt/create_a_model.md/0
{ "file_path": "transformers/docs/source/pt/create_a_model.md", "repo_id": "transformers", "token_count": 5956 }
566
python_sources()
llama_index/llama-index-core/llama_index/core/indices/vector_store/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/vector_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,184
from langchain_community.callbacks.arize_callback import ArizeCallbackHandler __all__ = ["ArizeCallbackHandler"]
langchain/libs/langchain/langchain/callbacks/arize_callback.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/arize_callback.py", "repo_id": "langchain", "token_count": 31 }
479
from langchain_community.utilities.jira import JiraAPIWrapper __all__ = ["JiraAPIWrapper"]
langchain/libs/langchain/langchain/utilities/jira.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/jira.py", "repo_id": "langchain", "token_count": 31 }
563
# Qdrant >[Qdrant](https://qdrant.tech/documentation/) (read: quadrant) is a vector similarity search engine. > It provides a production-ready service with a convenient API to store, search, and manage > points - vectors with an additional payload. `Qdrant` is tailored to extended filtering support. ## Installatio...
langchain/docs/docs/integrations/providers/qdrant.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/qdrant.mdx", "repo_id": "langchain", "token_count": 209 }
150
src/load/import_type.ts src/load/import_map.ts
langchainjs/langchain/.prettierignore/0
{ "file_path": "langchainjs/langchain/.prettierignore", "repo_id": "langchainjs", "token_count": 20 }
874
import { CollegeConfidentialLoader } from "langchain/document_loaders/web/college_confidential"; export const run = async () => { const loader = new CollegeConfidentialLoader( "https://www.collegeconfidential.com/colleges/brown-university/" ); const docs = await loader.load(); console.log({ docs }); };
langchainjs/examples/src/document_loaders/college_confidential.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/college_confidential.ts", "repo_id": "langchainjs", "token_count": 93 }
782
python_sources()
llama_index/llama-index-cli/llama_index/cli/new_package/common/BUILD/0
{ "file_path": "llama_index/llama-index-cli/llama_index/cli/new_package/common/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,158
"""Chain for applying removals of logical fallacies.""" from __future__ import annotations from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForChainRun from langchain.chains.base import Chain from langchain.chains.llm import LLMChain from langchain.schema import Base...
langchain/libs/experimental/langchain_experimental/fallacy_removal/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/fallacy_removal/base.py", "repo_id": "langchain", "token_count": 3089 }
442
"""Query pipeline components.""" from inspect import signature from typing import Any, Callable, Dict, Optional, Set, Tuple from llama_index.legacy.bridge.pydantic import Field, PrivateAttr from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.core.query_pipeline.query_component import...
llama_index/llama-index-legacy/llama_index/legacy/core/query_pipeline/components.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/query_pipeline/components.py", "repo_id": "llama_index", "token_count": 3469 }
1,557
# Image Tabular Chart Loader (Deplot) This loader captions an image file containing a tabular chart (bar chart, line charts) using deplot. ## Usage To use this loader, you need to pass in a `Path` to a local file. ```python from pathlib import Path from llama_hub.file.image_deplot import ImageTabularChartReader lo...
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/image_deplot/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/image_deplot/README.md", "repo_id": "llama_index", "token_count": 125 }
1,293
terraform { required_providers { digitalocean = { source = "digitalocean/digitalocean" version = "~> 2.0" } } } # Define provider variable "do_token" {} # Configure the DigitalOcean Provider provider "digitalocean" { token = var.do_token } resource "digitalocean_firewall" "chroma_firewall"...
chroma/examples/deployments/do-terraform/chroma.tf/0
{ "file_path": "chroma/examples/deployments/do-terraform/chroma.tf", "repo_id": "chroma", "token_count": 1504 }
38
# scikit-learn >[scikit-learn](https://scikit-learn.org/stable/) is an open-source collection of machine learning algorithms, > including some implementations of the [k nearest neighbors](https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html). `SKLearnVectorStore` wraps this implem...
langchain/docs/docs/integrations/providers/sklearn.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/sklearn.mdx", "repo_id": "langchain", "token_count": 240 }
148
<!--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/ko/optimization/habana.md/0
{ "file_path": "diffusers/docs/source/ko/optimization/habana.md", "repo_id": "diffusers", "token_count": 1911 }
189
# Auto Merging Retriever import logging from collections import defaultdict from typing import Dict, List, Optional, Tuple, cast from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.indices.query.schema import QueryBundl...
llama_index/llama-index-legacy/llama_index/legacy/retrievers/auto_merging_retriever.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/retrievers/auto_merging_retriever.py", "repo_id": "llama_index", "token_count": 3326 }
1,600
import CodeBlock from "@theme/CodeBlock"; # Unstructured This page covers how to use [Unstructured](https://unstructured.io) within LangChain. ## What is Unstructured? Unstructured is an [open source](https://github.com/Unstructured-IO/unstructured) Python package for extracting text from raw documents for use in m...
langchainjs/docs/core_docs/docs/ecosystem/integrations/unstructured.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/ecosystem/integrations/unstructured.mdx", "repo_id": "langchainjs", "token_count": 1025 }
691
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-bagel/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-bagel/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,296
package querycoord import ( "sort" "testing" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus/internal/kv" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" "github.com/milvus-io/milvus/internal/proto/querypb" . "github.com/milvus-io/milvus/internal/querycoordv2/params" "github.com/milvus...
milvus/internal/metastore/kv/querycoord/kv_catalog_test.go/0
{ "file_path": "milvus/internal/metastore/kv/querycoord/kv_catalog_test.go", "repo_id": "milvus", "token_count": 2088 }
1,942
import { BaseOutputParser } from "@langchain/core/output_parsers"; import { MasterHandler } from "./expression_type_handlers/factory.js"; import { ParsedType } from "./expression_type_handlers/types.js"; import { ASTParser } from "./expression_type_handlers/base.js"; /** * okay so we need to be able to handle the foll...
langchainjs/langchain/src/output_parsers/expression.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/expression.ts", "repo_id": "langchainjs", "token_count": 933 }
1,001
"""Faiss reader.""" from typing import Any, Dict, List import numpy as np from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class FaissReader(BaseReader): """Faiss reader. Retrieves documents through an existing in-memory Faiss index. These documents can ...
llama_index/llama-index-integrations/readers/llama-index-readers-faiss/llama_index/readers/faiss/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-faiss/llama_index/readers/faiss/base.py", "repo_id": "llama_index", "token_count": 1110 }
1,343
# Split by character This is the simplest method. This splits based on characters (by default "\n\n") and measure chunk length by number of characters. 1. How the text is split: by single character 2. How the chunk size is measured: by number of characters # CharacterTextSplitter Besides the `RecursiveCharacterText...
langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/character_text_splitter.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/character_text_splitter.mdx", "repo_id": "langchainjs", "token_count": 224 }
730
package storage import ( "bytes" "fmt" "github.com/apache/arrow/go/v12/arrow" "github.com/apache/arrow/go/v12/parquet" "github.com/apache/arrow/go/v12/parquet/file" "github.com/cockroachdb/errors" "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" ) // PayloadReader re...
milvus/internal/storage/payload_reader.go/0
{ "file_path": "milvus/internal/storage/payload_reader.go", "repo_id": "milvus", "token_count": 6213 }
1,863
<jupyter_start><jupyter_text>Criteria Evaluation[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/evaluation/string/criteria_eval_chain.ipynb)In scenarios where you wish to assess a model's output using a specific rubric or criteria set, the `criteria` evaluator proves to b...
langchain/docs/docs/guides/evaluation/string/criteria_eval_chain.ipynb/0
{ "file_path": "langchain/docs/docs/guides/evaluation/string/criteria_eval_chain.ipynb", "repo_id": "langchain", "token_count": 2942 }
91
<!--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 applicable law or agreed...
transformers/docs/source/en/hpo_train.md/0
{ "file_path": "transformers/docs/source/en/hpo_train.md", "repo_id": "transformers", "token_count": 2076 }
497
// 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/querynodev2/delegator/delegator_data_test.go/0
{ "file_path": "milvus/internal/querynodev2/delegator/delegator_data_test.go", "repo_id": "milvus", "token_count": 13526 }
1,837
# coding=utf-8 # Copyright 2022 The HuggingFace Team 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/LIC...
transformers/src/transformers/models/decision_transformer/modeling_decision_transformer.py/0
{ "file_path": "transformers/src/transformers/models/decision_transformer/modeling_decision_transformer.py", "repo_id": "transformers", "token_count": 18625 }
619
<jupyter_start><jupyter_text>Predibase[Predibase](https://predibase.com/) allows you to train, fine-tune, and deploy any ML model—from linear regression to large language model. This example demonstrates using Langchain with models deployed on Predibase SetupTo run this notebook, you'll need a [Predibase account](http...
langchain/docs/docs/integrations/llms/predibase.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/predibase.ipynb", "repo_id": "langchain", "token_count": 906 }
122
# 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 applicabl...
transformers/tests/generation/test_flax_utils.py/0
{ "file_path": "transformers/tests/generation/test_flax_utils.py", "repo_id": "transformers", "token_count": 5082 }
716
<jupyter_start><jupyter_text>ApifyThis notebook shows how to use the [Apify integration](/docs/integrations/providers/apify) for LangChain.[Apify](https://apify.com) is a cloud platform for web scraping and data extraction,which provides an [ecosystem](https://apify.com/store) of more than a thousandready-made apps cal...
langchain/docs/docs/integrations/tools/apify.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/apify.ipynb", "repo_id": "langchain", "token_count": 950 }
171
import { expect, test } from "@jest/globals"; import { loadEvaluator } from "../../loader.js"; test("Test Embedding Distance", async () => { const chain = await loadEvaluator("embedding_distance"); const res = await chain.evaluateStrings({ prediction: "I shall go", reference: "I shan't go", }); conso...
langchainjs/langchain/src/evaluation/embedding_distance/tests/embedding_distance_eval_chain.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/evaluation/embedding_distance/tests/embedding_distance_eval_chain.int.test.ts", "repo_id": "langchainjs", "token_count": 304 }
891
# coding=utf-8 # 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 requir...
transformers/examples/research_projects/jax-projects/hybrid_clip/modeling_hybrid_clip.py/0
{ "file_path": "transformers/examples/research_projects/jax-projects/hybrid_clip/modeling_hybrid_clip.py", "repo_id": "transformers", "token_count": 7975 }
525
## Usage Pattern ### Defining a custom prompt Defining a custom prompt is as simple as creating a format string ```python from llama_index.core import PromptTemplate template = ( "We have provided context information below. \n" "---------------------\n" "{context_str}" "\n---------------------\n" ...
llama_index/docs/module_guides/models/prompts/usage_pattern.md/0
{ "file_path": "llama_index/docs/module_guides/models/prompts/usage_pattern.md", "repo_id": "llama_index", "token_count": 2352 }
1,229
pub mod attention_processor; pub mod common; pub mod ddpm; pub mod diffnext; pub mod paella_vq; pub mod prior;
candle/candle-transformers/src/models/wuerstchen/mod.rs/0
{ "file_path": "candle/candle-transformers/src/models/wuerstchen/mod.rs", "repo_id": "candle", "token_count": 38 }
78
import { ChatOpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { RunnableSequence } from "@langchain/core/runnables"; const model = new ChatOpenAI({}); const promptTemplate = PromptTemplate.fromTemplate( "Tell me a joke about {topic}" ); // You can also create a cha...
langchainjs/examples/src/guides/expression_language/interface_invoke.ts/0
{ "file_path": "langchainjs/examples/src/guides/expression_language/interface_invoke.ts", "repo_id": "langchainjs", "token_count": 183 }
821
# 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/examples/test_examples_utils.py/0
{ "file_path": "diffusers/examples/test_examples_utils.py", "repo_id": "diffusers", "token_count": 714 }
225
"""ClickHouse reader.""" import logging from typing import Any, List, Optional import clickhouse_connect from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document logger = logging.getLogger(__name__) def escape_str(value: str) -> str: BS = "\\" must_escape = (BS, "'") ...
llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/llama_index/readers/clickhouse/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/llama_index/readers/clickhouse/base.py", "repo_id": "llama_index", "token_count": 2394 }
1,387
from llama_index.core.readers.base import BaseReader from llama_index.readers.opendal import ( OpendalAzblobReader, OpendalGcsReader, OpendalReader, OpendalS3Reader, ) def test_class(): names_of_base_classes = [b.__name__ for b in OpendalReader.__mro__] assert BaseReader.__name__ in names_of_b...
llama_index/llama-index-integrations/readers/llama-index-readers-opendal/tests/test_readers_opendal_reader.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/tests/test_readers_opendal_reader.py", "repo_id": "llama_index", "token_count": 290 }
1,499
[internal] creation_date = "2023-05-01" updated_date = "2022-05-01" release = ["release_type"] min_endpoint_version = "some_semantic_version" os_list = ["operating_system_list"] [rule] uuid = "some_uuid" name = "Fake Rule Name" description = "Fake description of rule" query = ''' process where process.name : "somequer...
langchain/docs/docs/integrations/document_loaders/example_data/fake_rule.toml/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/example_data/fake_rule.toml", "repo_id": "langchain", "token_count": 183 }
113
<jupyter_start><jupyter_text>Docstore DemoThis guide shows you how to directly use our `DocumentStore` abstraction. By putting nodes in the docstore, this allows you to define multiple indices over the same underlying docstore, instead of duplicating data across indices. If you're opening this Notebook on colab, you wi...
llama_index/docs/examples/docstore/DocstoreDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/docstore/DocstoreDemo.ipynb", "repo_id": "llama_index", "token_count": 1162 }
1,096
package legacy import "github.com/milvus-io/milvus/internal/metastore/kv/rootcoord" const ( DDOperationPrefixBefore220 = rootcoord.ComponentPrefix + "/dd-operation" DDMsgSendPrefixBefore220 = rootcoord.ComponentPrefix + "/dd-msg-send" IndexMetaBefore220Prefix = rootcoord.ComponentPrefix + "/index" SegmentI...
milvus/cmd/tools/migration/legacy/constant.go/0
{ "file_path": "milvus/cmd/tools/migration/legacy/constant.go", "repo_id": "milvus", "token_count": 167 }
1,704
import { FaissStore } from "@langchain/community/vectorstores/faiss"; import { OpenAIEmbeddings } from "@langchain/openai"; // The directory of data saved from Python const directory = "your/directory/here"; // Load the vector store from the directory const loadedVectorStore = await FaissStore.loadFromPython( direc...
langchainjs/examples/src/indexes/vector_stores/faiss_loadfrompython.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/faiss_loadfrompython.ts", "repo_id": "langchainjs", "token_count": 135 }
847
import "./globals.css"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { title: "WebLangChain", description: "Chatbot that answers queries by doing research and citing sources", }; export default f...
weblangchain/nextjs/app/layout.tsx/0
{ "file_path": "weblangchain/nextjs/app/layout.tsx", "repo_id": "weblangchain", "token_count": 243 }
2,150
<jupyter_start><jupyter_text>SQL DatabaseThis notebook showcases an agent designed to interact with a `SQL` databases. The agent builds from [SQLDatabaseChain](https://python.langchain.com/docs/use_cases/tabular/sqlite). It is designed to answer more general questions about a database, as well as recover from errors.No...
langchain/docs/docs/integrations/toolkits/sql_database.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/sql_database.ipynb", "repo_id": "langchain", "token_count": 3587 }
180
from langsmith.env import __all__ as env_all from langsmith.env import get_git_info _EXPECTED = [ "get_docker_compose_command", "get_docker_compose_version", "get_docker_environment", "get_docker_version", "get_langchain_env_var_metadata", "get_langchain_env_vars", "get_langchain_environmen...
langsmith-sdk/python/tests/unit_tests/test_env.py/0
{ "file_path": "langsmith-sdk/python/tests/unit_tests/test_env.py", "repo_id": "langsmith-sdk", "token_count": 302 }
1,050
import inspect import warnings from typing import Any, Dict import pytest from langchain_core._api.beta_decorator import beta, warn_beta from langchain_core.pydantic_v1 import BaseModel @pytest.mark.parametrize( "kwargs, expected_message", [ ( { "name": "OldClass", ...
langchain/libs/core/tests/unit_tests/_api/test_beta_decorator.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/_api/test_beta_decorator.py", "repo_id": "langchain", "token_count": 3825 }
412
# LlamaIndex Graph Stores Integration: Nebula
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/README.md/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/README.md", "repo_id": "llama_index", "token_count": 10 }
1,206
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/yandex", newEntrypointName: "", newPackageName: "@langchain/yandex", }); export * from "@langchain/community/chat_models/yandex";
langchainjs/langchain/src/chat_models/yandex.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/yandex.ts", "repo_id": "langchainjs", "token_count": 99 }
966
"""Tool for the Golden API.""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.golden_query import GoldenQueryAPIWrapper class GoldenQueryRun(BaseTool): """Tool that adds the capability to qu...
langchain/libs/community/langchain_community/tools/golden_query/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/golden_query/tool.py", "repo_id": "langchain", "token_count": 385 }
285
use crate::quantized_nn::{linear_no_bias, Embedding, Linear, RmsNorm}; pub use crate::quantized_var_builder::VarBuilder; use candle::{DType, Device, Module, Result, Tensor, D}; use candle_nn::Activation; use std::sync::Arc; pub use crate::models::mistral::Config; #[derive(Debug, Clone)] struct RotaryEmbedding { s...
candle/candle-transformers/src/models/quantized_mistral.rs/0
{ "file_path": "candle/candle-transformers/src/models/quantized_mistral.rs", "repo_id": "candle", "token_count": 6082 }
73
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "retrievers/amazon_kendra", }); export * from "@langchain/community/retrievers/amazon_kendra";
langchainjs/langchain/src/retrievers/amazon_kendra.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/amazon_kendra.ts", "repo_id": "langchainjs", "token_count": 78 }
941
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/google/generativeai/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/google/generativeai/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,565
# 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/models/mbart/convert_mbart_original_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/mbart/convert_mbart_original_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 1117 }
630
# coding=utf-8 # Copyright 2020, 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 applicabl...
transformers/src/transformers/models/deprecated/bort/convert_bort_original_gluonnlp_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/bort/convert_bort_original_gluonnlp_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 6178 }
600
# ruff: noqa: E501 # fmt: off template = ( """ Transform the math story plot into a JSON object. Don't guess at any of the parts. {format_instructions} Story: Boris has seven times the number of pets as Marcia. Jan has three times the number of pets as Marcia. Marcia has two more pets than Cindy. # JSON: ...
langchain/libs/experimental/langchain_experimental/cpal/templates/univariate/causal.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/cpal/templates/univariate/causal.py", "repo_id": "langchain", "token_count": 1238 }
459
# 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/scripts/convert_versatile_diffusion_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_versatile_diffusion_to_diffusers.py", "repo_id": "diffusers", "token_count": 14925 }
237
"""Main entrypoint for the app.""" import asyncio import os from datetime import datetime from operator import itemgetter from typing import List, Optional, Sequence, Tuple, Union import langsmith from fastapi import FastAPI, Request, Depends from fastapi.middleware.cors import CORSMiddleware from langchain.callbacks....
weblangchain/main.py/0
{ "file_path": "weblangchain/main.py", "repo_id": "weblangchain", "token_count": 6180 }
2,004
cd /d %~dp0 bin\etcd.exe
milvus/deployments/windows/run_etcd.bat/0
{ "file_path": "milvus/deployments/windows/run_etcd.bat", "repo_id": "milvus", "token_count": 14 }
1,850
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Welcome to Candle!</title> <link data-trunk rel="copy-file" href="yolov8s.safetensors" /> <link data-trunk rel="copy-file" href="bike.jpeg" /> <link data-trunk rel="rust" href="Cargo.toml" data-bin="app" data-type="main" /> ...
candle/candle-wasm-examples/yolo/index.html/0
{ "file_path": "candle/candle-wasm-examples/yolo/index.html", "repo_id": "candle", "token_count": 322 }
77
import { CohereClient, Cohere as CohereTypes } from "cohere-ai"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import type { BaseLanguageMo...
langchainjs/libs/langchain-cohere/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-cohere/src/llms.ts", "repo_id": "langchainjs", "token_count": 1540 }
1,046
{ "openapi": "3.0.1", "info": { "title": "BizToc", "description": "Get the latest business news articles.", "version": "v1" }, "servers": [ { "url": "https://ai.biztoc.com" } ], "paths": { "/ai/news": { "get": { "operationId": "getNews"...
langchain/libs/langchain/tests/unit_tests/examples/test_specs/biztoc/apispec.json/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/examples/test_specs/biztoc/apispec.json", "repo_id": "langchain", "token_count": 547 }
658
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true ignore-words-list = "Gere" skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["PromptLayerHandler"] contains_example = false import_path = "l...
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/pyproject.toml", "repo_id": "llama_index", "token_count": 660 }
1,249
from langchain_community.chat_models.anyscale import ( ChatAnyscale, ) __all__ = ["ChatAnyscale"]
langchain/libs/langchain/langchain/chat_models/anyscale.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/anyscale.py", "repo_id": "langchain", "token_count": 39 }
478
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/finetuning/embeddings/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/embeddings/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,513
// 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/query/Expr.h/0
{ "file_path": "milvus/internal/core/src/query/Expr.h", "repo_id": "milvus", "token_count": 4025 }
1,876
from __future__ import annotations from typing import TYPE_CHECKING, List from langchain_core.pydantic_v1 import Field from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools import BaseTool from langchain_community.tools.slack.get_channel import SlackGetChannel from langchain_...
langchain/libs/community/langchain_community/agent_toolkits/slack/toolkit.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/slack/toolkit.py", "repo_id": "langchain", "token_count": 375 }
224
"""LlamaIndex objects.""" from llama_index.core.objects.base import ObjectIndex, ObjectRetriever from llama_index.core.objects.base_node_mapping import SimpleObjectNodeMapping from llama_index.core.objects.table_node_mapping import ( SQLTableNodeMapping, SQLTableSchema, ) from llama_index.core.objects.tool_nod...
llama_index/llama-index-core/llama_index/core/objects/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/objects/__init__.py", "repo_id": "llama_index", "token_count": 217 }
1,192
<jupyter_start><jupyter_text>Motörhead>[Motörhead](https://github.com/getmetal/motorhead) is a memory server implemented in Rust. It automatically handles incremental summarization in the background and allows for stateless applications. SetupSee instructions at [Motörhead](https://github.com/getmetal/motorhead) for ru...
langchain/docs/docs/integrations/memory/motorhead_memory.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/motorhead_memory.ipynb", "repo_id": "langchain", "token_count": 514 }
135
import { OpenAI } from "@langchain/openai"; const model = new OpenAI({}); const promptAsString = "Human: Tell me a short joke about ice cream"; const response = await model.invoke(promptAsString); console.log(response); /** Why did the ice cream go to therapy? Because it was feeling a little rocky road. */
langchainjs/examples/src/guides/expression_language/get_started/llm_model.ts/0
{ "file_path": "langchainjs/examples/src/guides/expression_language/get_started/llm_model.ts", "repo_id": "langchainjs", "token_count": 89 }
840
from typing import Iterator, List, Union import requests from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class BrowserlessLoader(BaseLoader): """Load webpages with `Browserless` /content endpoint.""" def __init__( self, api_token: str, ...
langchain/libs/community/langchain_community/document_loaders/browserless.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/browserless.py", "repo_id": "langchain", "token_count": 1226 }
232
"""Test Baidu Qianfan Embedding Endpoint.""" from langchain_community.embeddings.baidu_qianfan_endpoint import ( QianfanEmbeddingsEndpoint, ) def test_embedding_multiple_documents() -> None: documents = ["foo", "bar"] embedding = QianfanEmbeddingsEndpoint() output = embedding.embed_documents(documents...
langchain/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_qianfan_endpoint.py", "repo_id": "langchain", "token_count": 446 }
332
# Copyright 2024 Alibaba DAMO-VILAB and The HuggingFace Team. All rights reserved. # Copyright 2024 The ModelScope 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.apa...
diffusers/src/diffusers/models/unets/unet_3d_condition.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/unet_3d_condition.py", "repo_id": "diffusers", "token_count": 14536 }
239
// 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/core/src/query/Plan.h/0
{ "file_path": "milvus/internal/core/src/query/Plan.h", "repo_id": "milvus", "token_count": 674 }
1,662
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation. # 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 ...
transformers/src/transformers/models/mpnet/modeling_mpnet.py/0
{ "file_path": "transformers/src/transformers/models/mpnet/modeling_mpnet.py", "repo_id": "transformers", "token_count": 18320 }
660
# from llama_index.tools.requests.base import ( INVALID_URL_PROMPT, RequestsToolSpec, ) __all__ = ["INVALID_URL_PROMPT", "RequestsToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-requests/llama_index/tools/requests/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-requests/llama_index/tools/requests/__init__.py", "repo_id": "llama_index", "token_count": 65 }
1,578
<!--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 applicable law or agreed...
transformers/docs/source/en/model_doc/yolos.md/0
{ "file_path": "transformers/docs/source/en/model_doc/yolos.md", "repo_id": "transformers", "token_count": 1089 }
524
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/sheets/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/sheets/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,326
"""Adapted from https://github.com/jzbjyb/FLARE"""
langchain/libs/langchain/langchain/chains/flare/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/flare/__init__.py", "repo_id": "langchain", "token_count": 20 }
466
# Persisting & Loading Data ## Persisting Data By default, LlamaIndex stores data in-memory, and this data can be explicitly persisted if desired: ```python storage_context.persist(persist_dir="<persist_dir>") ``` This will persist data to disk, under the specified `persist_dir` (or `./storage` by default). Multip...
llama_index/docs/module_guides/storing/save_load.md/0
{ "file_path": "llama_index/docs/module_guides/storing/save_load.md", "repo_id": "llama_index", "token_count": 1215 }
1,162
"""Test vector store indexes.""" from pathlib import Path from typing import List import pytest from llama_index.legacy.indices.vector_store.base import VectorStoreIndex from llama_index.legacy.schema import Document, TextNode from llama_index.legacy.service_context import ServiceContext from llama_index.legacy.stora...
llama_index/llama-index-legacy/tests/indices/vector_store/test_txtai.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/test_txtai.py", "repo_id": "llama_index", "token_count": 1158 }
1,804
import type { Message } from "$lib/types/Message"; import { format } from "date-fns"; import { generateFromDefaultEndpoint } from "../generateFromDefaultEndpoint"; import { WEBSEARCH_ALLOWLIST, WEBSEARCH_BLOCKLIST } from "$env/static/private"; import { z } from "zod"; import JSON5 from "json5"; const listSchema = z.ar...
chat-ui/src/lib/server/websearch/generateQuery.ts/0
{ "file_path": "chat-ui/src/lib/server/websearch/generateQuery.ts", "repo_id": "chat-ui", "token_count": 898 }
100
<!-- Copyright 2023 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 agree...
transformers/docs/source/ja/preprocessing.md/0
{ "file_path": "transformers/docs/source/ja/preprocessing.md", "repo_id": "transformers", "token_count": 12716 }
521
// 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/index/VectorIndex.h/0
{ "file_path": "milvus/internal/core/src/index/VectorIndex.h", "repo_id": "milvus", "token_count": 1119 }
1,660
"""Init file."""
llama_index/llama-index-legacy/tests/indices/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,629
python_sources() python_tests( name="tests", )
llama_index/llama-index-core/tests/indices/keyword_table/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/indices/keyword_table/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,150
--- sidebar_position: 0 title: Quickstart --- # Quickstart In this guide we'll go over the basic ways to create a Q&A chain and agent over a SQL database. These systems will allow us to ask a question about the data in a SQL database and get back a natural language answer. The main difference between the two is that ...
langchainjs/docs/core_docs/docs/use_cases/sql/quickstart.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/sql/quickstart.mdx", "repo_id": "langchainjs", "token_count": 1695 }
777
from dataclasses import dataclass from typing import Any, Callable, Dict, List, Optional, cast from llama_index.legacy.callbacks.base_handler import BaseCallbackHandler from llama_index.legacy.callbacks.schema import CBEventType, EventPayload from llama_index.legacy.utilities.token_counting import TokenCounter from ll...
llama_index/llama-index-legacy/llama_index/legacy/callbacks/token_counting.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/token_counting.py", "repo_id": "llama_index", "token_count": 3635 }
1,642
# 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 applicabl...
diffusers/src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py", "repo_id": "diffusers", "token_count": 12895 }
254
# Langchain Tests [This guide has moved to the docs](https://python.langchain.com/docs/contributing/testing)
langchain/libs/langchain/tests/README.md/0
{ "file_path": "langchain/libs/langchain/tests/README.md", "repo_id": "langchain", "token_count": 33 }
621
# coding=utf-8 # Copyright 2018 Google AI, Google Brain 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 # # U...
transformers/src/transformers/models/big_bird/tokenization_big_bird_fast.py/0
{ "file_path": "transformers/src/transformers/models/big_bird/tokenization_big_bird_fast.py", "repo_id": "transformers", "token_count": 4758 }
623
"""Tools.""" from llama_index.core.tools.download import download_tool from llama_index.core.tools.function_tool import FunctionTool from llama_index.core.tools.query_engine import QueryEngineTool from llama_index.core.tools.query_plan import QueryPlanTool from llama_index.core.tools.retriever_tool import RetrieverToo...
llama_index/llama-index-core/llama_index/core/tools/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/tools/__init__.py", "repo_id": "llama_index", "token_count": 258 }
1,302
// 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/core/unittest/test_utils/Distance.h/0
{ "file_path": "milvus/internal/core/unittest/test_utils/Distance.h", "repo_id": "milvus", "token_count": 405 }
1,957
python_tests()
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,584
FROM google/cloud-sdk:slim # Build args. ARG GITHUB_REF=refs/heads/main # TODO: This Dockerfile installs pytorch/xla 3.6 wheels. There are also 3.7 # wheels available; see below. ENV PYTHON_VERSION=3.6 RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ ...
transformers/docker/transformers-pytorch-tpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-pytorch-tpu/Dockerfile", "repo_id": "transformers", "token_count": 1235 }
475