text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# neo4j-cypher-memory
This template allows you to have conversations with a Neo4j graph database in natural language, using an OpenAI LLM.
It transforms a natural language question into a Cypher query (used to fetch data from Neo4j databases), executes the query, and provides a natural language response based on the ... | langchain/templates/neo4j-cypher-memory/README.md/0 | {
"file_path": "langchain/templates/neo4j-cypher-memory/README.md",
"repo_id": "langchain",
"token_count": 1063
} | 656 |
// 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_reduce_c.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_reduce_c.cpp",
"repo_id": "milvus",
"token_count": 471
} | 1,820 |
import { OpenAI } from "@langchain/openai";
import { LLMChain } from "langchain/chains";
import { PromptTemplate } from "@langchain/core/prompts";
// We can construct an LLMChain from a PromptTemplate and an LLM.
const model = new OpenAI({ temperature: 0 });
const prompt = PromptTemplate.fromTemplate(
"What is a goo... | langchainjs/examples/src/chains/llm_chain.ts/0 | {
"file_path": "langchainjs/examples/src/chains/llm_chain.ts",
"repo_id": "langchainjs",
"token_count": 292
} | 819 |
from langchain.prompts.pipeline import __all__
EXPECTED_ALL = ["PipelinePromptTemplate", "_get_inputs"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain/libs/langchain/tests/unit_tests/prompts/test_pipeline.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/prompts/test_pipeline.py",
"repo_id": "langchain",
"token_count": 71
} | 605 |
import logging
from dataclasses import dataclass
from typing import Any, List, Optional, cast
from deprecated import deprecated
import llama_index.core
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.callbacks.base import CallbackManager
from llama_index.core.base.embeddings.base import B... | llama_index/llama-index-core/llama_index/core/service_context.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/service_context.py",
"repo_id": "llama_index",
"token_count": 6937
} | 1,207 |
// 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/pkg/util/hardware/hardware_info.go/0 | {
"file_path": "milvus/pkg/util/hardware/hardware_info.go",
"repo_id": "milvus",
"token_count": 1082
} | 2,053 |
import init, { Model } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "phi-mixformer-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedResponse.arrayBuffer();
return new... | candle/candle-wasm-examples/phi/phiWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/phi/phiWorker.js",
"repo_id": "candle",
"token_count": 1667
} | 89 |
from typing import TYPE_CHECKING
from ....utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is_torch_available()):
... | diffusers/src/diffusers/pipelines/deprecated/vq_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/vq_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 682
} | 225 |
"""Chain that carries on a conversation from a prompt plus history."""
| langchain/libs/langchain/langchain/chains/conversation/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/conversation/__init__.py",
"repo_id": "langchain",
"token_count": 15
} | 501 |
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "@langchain/openai";
const vectorStore = await MemoryVectorStore.fromTexts(
["Hello world", "Bye bye", "hello nice world"],
[{ id: 2 }, { id: 1 }, { id: 3 }],
new OpenAIEmbeddings()
);
const resultOne = await vec... | langchainjs/examples/src/indexes/vector_stores/memory.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/memory.ts",
"repo_id": "langchainjs",
"token_count": 172
} | 815 |
"""Query Pipeline."""
import json
import uuid
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Tuple,
Union,
cast,
get_args,
)
import networkx
from llama_index.core.async_utils import run_jobs
from llama_index.core.bridge.pydantic import Field
from llama_ind... | llama_index/llama-index-core/llama_index/core/query_pipeline/query.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/query_pipeline/query.py",
"repo_id": "llama_index",
"token_count": 10852
} | 1,291 |
from langchain_core.prompt_values import PromptValue
__all__ = ["PromptValue"]
| langchain/libs/langchain/langchain/schema/prompt.py/0 | {
"file_path": "langchain/libs/langchain/langchain/schema/prompt.py",
"repo_id": "langchain",
"token_count": 25
} | 542 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.predibase import PredibaseLLM
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in PredibaseLLM.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,419 |
---
sidebar_position: 5
---
# Tracking token usage
This notebook goes over how to track your token usage for specific calls. This is currently only implemented for the OpenAI API.
Here's an example of tracking token usage for a single Chat model call:
import CodeBlock from "@theme/CodeBlock";
import Example from "@... | langchainjs/docs/core_docs/docs/modules/model_io/chat/token_usage_tracking.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/model_io/chat/token_usage_tracking.mdx",
"repo_id": "langchainjs",
"token_count": 200
} | 768 |
import candle
from candle import Tensor
from candle.utils import cuda_is_available
from candle.testing import assert_equal
import pytest
def test_tensor_can_be_constructed():
t = Tensor(42.0)
assert t.values() == 42.0
def test_tensor_can_be_constructed_from_list():
t = Tensor([3.0, 1, 4, 1, 5, 9, 2, 6])... | candle/candle-pyo3/tests/native/test_tensor.py/0 | {
"file_path": "candle/candle-pyo3/tests/native/test_tensor.py",
"repo_id": "candle",
"token_count": 4688
} | 64 |
// 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/SearchBruteForce.cpp/0 | {
"file_path": "milvus/internal/core/src/query/SearchBruteForce.cpp",
"repo_id": "milvus",
"token_count": 3010
} | 1,733 |
from llama_index.llms.nvidia_tensorrt.base import LocalTensorRTLLM
__all__ = ["LocalTensorRTLLM"]
| llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/__init__.py",
"repo_id": "llama_index",
"token_count": 39
} | 1,236 |
export { GmailCreateDraft } from "./create_draft.js";
export { GmailGetMessage } from "./get_message.js";
export { GmailGetThread } from "./get_thread.js";
export { GmailSearch } from "./search.js";
export { GmailSendMessage } from "./send_message.js";
export type { GmailBaseToolParams } from "./base.js";
export type ... | langchainjs/libs/langchain-community/src/tools/gmail/index.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/gmail/index.ts",
"repo_id": "langchainjs",
"token_count": 182
} | 1,005 |
// 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/rootcoord/metrics_info.go/0 | {
"file_path": "milvus/internal/rootcoord/metrics_info.go",
"repo_id": "milvus",
"token_count": 1158
} | 1,779 |
import json
from typing import Any, Dict, List, Optional, Tuple, Type
from urllib.parse import urlparse
from llama_index.core.storage.kvstore.types import (
DEFAULT_BATCH_SIZE,
DEFAULT_COLLECTION,
BaseKVStore,
)
IMPORT_ERROR_MSG = "`asyncpg` package not found, please run `pip install asyncpg`"
def get_d... | llama_index/llama-index-core/llama_index/core/storage/kvstore/postgres_kvstore.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/storage/kvstore/postgres_kvstore.py",
"repo_id": "llama_index",
"token_count": 7120
} | 1,251 |
---
hide_table_of_contents: true
---
# Cloudflare Vectorize
If you're deploying your project in a Cloudflare worker, you can use [Cloudflare Vectorize](https://developers.cloudflare.com/vectorize/) with LangChain.js.
It's a powerful and convenient option that's built directly into Cloudflare.
## Setup
:::tip Compat... | langchainjs/docs/core_docs/docs/integrations/vectorstores/cloudflare_vectorize.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/cloudflare_vectorize.mdx",
"repo_id": "langchainjs",
"token_count": 684
} | 773 |
# 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/src/transformers/models/clip/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/clip/__init__.py",
"repo_id": "transformers",
"token_count": 2215
} | 647 |
{
"vocab_size": 50265,
"hidden_size": 768,
"num_hidden_layers": 6,
"num_attention_heads": 12,
"intermediate_size": 3072,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"attention_probs_dropout_prob": 0.1,
"max_position_embeddings": 514,
"type_vocab_size": 1,
"initializer_r... | transformers/examples/research_projects/distillation/training_configs/distilroberta-base.json/0 | {
"file_path": "transformers/examples/research_projects/distillation/training_configs/distilroberta-base.json",
"repo_id": "transformers",
"token_count": 178
} | 575 |
<!--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/ko/testing.md/0 | {
"file_path": "transformers/docs/source/ko/testing.md",
"repo_id": "transformers",
"token_count": 35298
} | 544 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/llama_index/embeddings/huggingface_optimum/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/llama_index/embeddings/huggingface_optimum/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,277 |
import { Index } from "@upstash/vector";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { UpstashVectorStore } from "@langchain/community/vectorstores/upstash";
const index = new Index({
url: process.env.UPSTASH_VECTOR_REST_URL as string,
token: p... | langchainjs/examples/src/indexes/vector_stores/upstash/index_and_query_docs.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/upstash/index_and_query_docs.ts",
"repo_id": "langchainjs",
"token_count": 579
} | 834 |
# coding=utf-8
# Copyright 2023 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/pop2piano/processing_pop2piano.py/0 | {
"file_path": "transformers/src/transformers/models/pop2piano/processing_pop2piano.py",
"repo_id": "transformers",
"token_count": 2200
} | 669 |
/* eslint-disable no-process-env */
import { test, expect, beforeEach, afterEach } from "@jest/globals";
import { DataSource } from "typeorm";
import {
InfoSqlTool,
QuerySqlTool,
ListTablesSqlTool,
QueryCheckerTool,
} from "../../tools/sql.js";
import { SqlDatabase } from "../../sql_db.js";
const previousEnv =... | langchainjs/langchain/src/agents/tests/sql.test.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/tests/sql.test.ts",
"repo_id": "langchainjs",
"token_count": 1621
} | 843 |
# Robocorp
>[Robocorp](https://robocorp.com/) helps build and operate Python workers that run seamlessly anywhere at any scale
## Installation and Setup
You need to install `langchain-robocorp` python package:
```bash
pip install langchain-robocorp
```
You will need a running instance of Action Server to communi... | langchain/docs/docs/integrations/providers/robocorp.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/robocorp.mdx",
"repo_id": "langchain",
"token_count": 222
} | 151 |
<jupyter_start><jupyter_text>Completion Prompts Customization If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-openai
!pip install llama-index<jupyter_output><empty_output><jupyter_text>Prompt SetupBelow, we take the default prompts an... | llama_index/docs/examples/customization/prompts/completion_prompts.ipynb/0 | {
"file_path": "llama_index/docs/examples/customization/prompts/completion_prompts.ipynb",
"repo_id": "llama_index",
"token_count": 912
} | 1,174 |
"""
TruLens-Eval LlamaPack.
"""
from typing import Any, Dict, List
from llama_index.core.indices.vector_store import VectorStoreIndex
from llama_index.core.llama_pack.base import BaseLlamaPack
from llama_index.core.schema import TextNode
class TruLensRAGTriadPack(BaseLlamaPack):
"""
The TruLens-Eval RAG Tri... | llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/llama_index/packs/trulens_eval_packs/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/llama_index/packs/trulens_eval_packs/base.py",
"repo_id": "llama_index",
"token_count": 5152
} | 1,877 |
FROM golang:1.20-alpine3.18 as build
RUN apk add --no-cache make git build-base bash
ENV PATH=$PATH:/go/bin
ADD ./go/coordinator /src/chroma-coordinator
RUN cd /src/chroma-coordinator \
&& make
FROM alpine:3.17.3
RUN apk add --no-cache bash bash-completion jq findutils
# As of 6 Dec 2023, the atlas package is... | chroma/go/coordinator/Dockerfile/0 | {
"file_path": "chroma/go/coordinator/Dockerfile",
"repo_id": "chroma",
"token_count": 337
} | 44 |
# coding=utf-8
# Copyright 2021 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/visual_bert/convert_visual_bert_original_pytorch_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/visual_bert/convert_visual_bert_original_pytorch_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 2115
} | 692 |
# LlamaIndex Readers Integration: Mbox
| llama_index/llama-index-integrations/readers/llama-index-readers-mbox/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mbox/README.md",
"repo_id": "llama_index",
"token_count": 10
} | 1,333 |
<!--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/zh/preprocessing.md/0 | {
"file_path": "transformers/docs/source/zh/preprocessing.md",
"repo_id": "transformers",
"token_count": 12747
} | 550 |
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
name: test-querynode-pod-kill
namespace: chaos-testing
spec:
selector:
pods:
chaos-testing:
- milvus-multi-querynode-querynode-bcdc595d9-7vmcj
- milvus-multi-querynode-querynode-bcdc595d9-ccxls
- milvus-multi-querynode-... | milvus/tests/python_client/chaos/chaos_objects/template/pod-kill-by-pod-list.yaml/0 | {
"file_path": "milvus/tests/python_client/chaos/chaos_objects/template/pod-kill-by-pod-list.yaml",
"repo_id": "milvus",
"token_count": 184
} | 1,891 |
# 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/distilbert/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/distilbert/__init__.py",
"repo_id": "transformers",
"token_count": 2215
} | 652 |
from llama_index.core.indices.vector_store.retrievers.retriever import (
VectorIndexRetriever,
)
from llama_index.core.indices.vector_store.retrievers.auto_retriever import (
VectorIndexAutoRetriever,
)
__all__ = [
"VectorIndexRetriever",
"VectorIndexAutoRetriever",
]
| llama_index/llama-index-core/llama_index/core/indices/vector_store/retrievers/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/vector_store/retrievers/__init__.py",
"repo_id": "llama_index",
"token_count": 109
} | 1,127 |
import * as uuid from "uuid";
import type { ChromaClient as ChromaClientT, Collection } from "chromadb";
import type { CollectionMetadata, Where } from "chromadb/dist/main/types.js";
import type { EmbeddingsInterface } from "@langchain/core/embeddings";
import { VectorStore } from "@langchain/core/vectorstores";
impor... | langchainjs/libs/langchain-community/src/vectorstores/chroma.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/chroma.ts",
"repo_id": "langchainjs",
"token_count": 4144
} | 977 |
# RAG CLI
One common use case is chatting with an LLM about files you have saved locally on your computer.
We have written a CLI tool to help you do just that! You can point the rag CLI tool to a set of files you've saved locally, and it will ingest those files into a local vector database that is then used for a Cha... | llama_index/docs/use_cases/q_and_a/rag_cli.md/0 | {
"file_path": "llama_index/docs/use_cases/q_and_a/rag_cli.md",
"repo_id": "llama_index",
"token_count": 2644
} | 1,105 |
python_sources()
| llama_index/llama-index-finetuning/llama_index/finetuning/callbacks/BUILD/0 | {
"file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/callbacks/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,251 |
// 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/pkg/mq/msgstream/mqwrapper/nmq/nmq_producer.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/nmq/nmq_producer.go",
"repo_id": "milvus",
"token_count": 870
} | 1,817 |
# @langchain/<ADD_PACKAGE_NAME_HERE>
This package contains the LangChain.js integrations for <ADD_NAME_HERE> through their SDK.
## Installation
```bash npm2yarn
npm install @langchain/<ADD_PACKAGE_NAME_HERE>
```
This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/pa... | langchainjs/libs/create-langchain-integration/template/README.md/0 | {
"file_path": "langchainjs/libs/create-langchain-integration/template/README.md",
"repo_id": "langchainjs",
"token_count": 1077
} | 928 |
<jupyter_start><jupyter_text>Google Vertex AI Search[Vertex AI Search](https://cloud.google.com/enterprise-search) (formerly known as Enterprise Search on Generative AI App Builder) is a part of the [Vertex AI](https://cloud.google.com/vertex-ai) machine learning platform offered by Google Cloud.Vertex AI Search lets o... | langchain/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb",
"repo_id": "langchain",
"token_count": 3085
} | 168 |
import { AI21 } from "@langchain/community/llms/ai21";
const model = new AI21({
ai21ApiKey: "YOUR_AI21_API_KEY", // Or set as process.env.AI21_API_KEY
});
const res = await model.call(`Translate "I love programming" into German.`);
console.log({ res });
/*
{
res: "\nIch liebe das Programmieren."
}
*/
| langchainjs/examples/src/models/llm/ai21.ts/0 | {
"file_path": "langchainjs/examples/src/models/llm/ai21.ts",
"repo_id": "langchainjs",
"token_count": 124
} | 872 |
from typing import Any, Dict, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Extra, SecretStr, root_validator
from langchain_core.utils import convert_to_secret_str, get_fro... | langchain/libs/community/langchain_community/llms/forefrontai.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/forefrontai.py",
"repo_id": "langchain",
"token_count": 1532
} | 268 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,318 |
from __future__ import annotations
import logging
from abc import abstractmethod
from typing import Any, Dict, List, Optional
import requests
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.pydantic_v1 import root_validator
from langchain_core.tools import BaseTool
from langchain_co... | langchain/libs/community/langchain_community/tools/edenai/edenai_base_tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/edenai/edenai_base_tool.py",
"repo_id": "langchain",
"token_count": 2272
} | 284 |
import pytest
@pytest.fixture(scope="module")
def flash_llama_handle(launcher):
with launcher("huggingface/llama-7b", num_shard=2) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_llama(flash_llama_handle):
await flash_llama_handle.health(300)
return flash_llama_handle.cli... | text-generation-inference/integration-tests/models/test_flash_llama.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_llama.py",
"repo_id": "text-generation-inference",
"token_count": 655
} | 399 |
import { z } from "zod";
import { zodToJsonSchema, JsonSchema7Type } from "zod-to-json-schema";
import { Validator } from "@langchain/core/utils/json_schema";
import { ChatOpenAI } from "@langchain/openai";
import { BasePromptTemplate } from "@langchain/core/prompts";
import {
BaseLLMOutputParser,
OutputParserExce... | langchainjs/langchain/src/chains/openai_functions/structured_output.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/openai_functions/structured_output.ts",
"repo_id": "langchainjs",
"token_count": 2398
} | 905 |
# 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/modeling_tf_outputs.py/0 | {
"file_path": "transformers/src/transformers/modeling_tf_outputs.py",
"repo_id": "transformers",
"token_count": 20580
} | 560 |
import { SQL_PROMPTS_MAP } from "langchain/chains/sql_db";
console.log({ SQL_PROMPTS_MAP: Object.keys(SQL_PROMPTS_MAP) });
/**
{
SQL_PROMPTS_MAP: [ 'oracle', 'postgres', 'sqlite', 'mysql', 'mssql', 'sap hana' ]
}
*/
// For example, using our current DB we can see that we’ll get a SQLite-specific prompt:
console.l... | langchainjs/examples/src/use_cases/sql/prompting/list_dialects.ts/0 | {
"file_path": "langchainjs/examples/src/use_cases/sql/prompting/list_dialects.ts",
"repo_id": "langchainjs",
"token_count": 592
} | 827 |
from llama_index.embeddings.adapter.base import (
AdapterEmbeddingModel,
LinearAdapterEmbeddingModel,
)
from llama_index.embeddings.adapter.utils import BaseAdapter, LinearLayer
__all__ = [
"AdapterEmbeddingModel",
"LinearAdapterEmbeddingModel",
"BaseAdapter",
"LinearLayer",
]
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/llama_index/embeddings/adapter/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/llama_index/embeddings/adapter/__init__.py",
"repo_id": "llama_index",
"token_count": 111
} | 1,266 |
# Contributing
Thanks for taking the time to contribute a new template!
We've tried to make this process as simple and painless as possible.
If you need any help at all, please reach out!
To contribute a new template, first fork this repository.
Then clone that fork and pull it down locally.
Set up an appropriate dev... | langchain/templates/docs/CONTRIBUTING.md/0 | {
"file_path": "langchain/templates/docs/CONTRIBUTING.md",
"repo_id": "langchain",
"token_count": 461
} | 646 |
# coding=utf-8
# Copyright 2019 Hugging Face 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 a... | transformers/tests/models/deberta/test_tokenization_deberta.py/0 | {
"file_path": "transformers/tests/models/deberta/test_tokenization_deberta.py",
"repo_id": "transformers",
"token_count": 3792
} | 779 |
locust_insert_performance:
collections:
-
milvus:
db_config.primary_path: /test/milvus/db_data_011/insert_sift_1m_128_l2_2
cache_config.cpu_cache_capacity: 8GB
cache_config.insert_buffer_size: 2GB
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_thresh... | milvus/tests/benchmark/milvus_benchmark/suites/2_locust_insert_5h.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/2_locust_insert_5h.yaml",
"repo_id": "milvus",
"token_count": 499
} | 1,950 |
"""Composable graph."""
# TODO: remove this file, only keep for backwards compatibility
from llama_index.legacy.indices.composability.graph import ComposableGraph # noqa
| llama_index/llama-index-legacy/llama_index/legacy/composability/base.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/composability/base.py",
"repo_id": "llama_index",
"token_count": 49
} | 1,583 |
<!--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/en/model_doc/blenderbot.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/blenderbot.md",
"repo_id": "transformers",
"token_count": 1405
} | 439 |
# Beam
This page covers how to use Beam within LangChain.
It is broken into two parts: installation and setup, and then references to specific Beam wrappers.
## Installation and Setup
- [Create an account](https://www.beam.cloud/)
- Install the Beam CLI with `curl https://raw.githubusercontent.com/slai-labs/get-beam... | langchain/docs/docs/integrations/providers/beam.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/beam.mdx",
"repo_id": "langchain",
"token_count": 1041
} | 130 |
# Chroma AutoRetrieval Pack
This LlamaPack inserts your data into chroma and insantiates an auto-retriever, which will use the LLM at runtime to set metadata filtering, top-k, and query string.
## CLI Usage
You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` pyth... | llama_index/llama-index-packs/llama-index-packs-chroma-autoretrieval/README.md/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-chroma-autoretrieval/README.md",
"repo_id": "llama_index",
"token_count": 703
} | 1,577 |
"""Autoretriever prompts."""
from llama_index.core.prompts.base import PromptTemplate
from llama_index.core.prompts.prompt_type import PromptType
from llama_index.core.vector_stores.types import (
FilterOperator,
MetadataFilter,
MetadataInfo,
VectorStoreInfo,
VectorStoreQuerySpec,
)
# NOTE: these ... | llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/prompts.py/0 | {
"file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/prompts.py",
"repo_id": "llama_index",
"token_count": 1470
} | 1,340 |
"""Test prompts."""
from typing import Any
import pytest
from llama_index.legacy.core.llms.types import ChatMessage, MessageRole
from llama_index.legacy.llms import MockLLM
from llama_index.legacy.prompts import (
ChatPromptTemplate,
LangchainPromptTemplate,
PromptTemplate,
SelectorPromptTemplate,
)
f... | llama_index/llama-index-legacy/tests/prompts/test_base.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/prompts/test_base.py",
"repo_id": "llama_index",
"token_count": 4367
} | 1,676 |
from typing import List
import pytest
from langchain.retrievers.web_research import QuestionListOutputParser
@pytest.mark.parametrize(
"text,expected",
(
(
"1. Line one.\n",
["1. Line one.\n"],
),
(
"1. Line one.",
["1. Line one."],
... | langchain/libs/langchain/tests/unit_tests/retrievers/test_web_research.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/retrievers/test_web_research.py",
"repo_id": "langchain",
"token_count": 465
} | 605 |
import { HF_ACCESS_TOKEN, HF_TOKEN } from "$env/static/private";
import { buildPrompt } from "$lib/buildPrompt";
import type { TextGenerationStreamOutput } from "@huggingface/inference";
import type { Endpoint } from "../endpoints";
import { z } from "zod";
export const endpointLlamacppParametersSchema = z.object({
w... | chat-ui/src/lib/server/endpoints/llamacpp/endpointLlamacpp.ts/0 | {
"file_path": "chat-ui/src/lib/server/endpoints/llamacpp/endpointLlamacpp.ts",
"repo_id": "chat-ui",
"token_count": 1132
} | 98 |
- sections:
- local: index
title: 🧨 Diffusers
- local: quicktour
title: Quicktour
- local: stable_diffusion
title: Effective and efficient diffusion
- local: installation
title: Installation
title: Get started
- sections:
- local: tutorials/tutorial_overview
title: Overview
- local: u... | diffusers/docs/source/en/_toctree.yml/0 | {
"file_path": "diffusers/docs/source/en/_toctree.yml",
"repo_id": "diffusers",
"token_count": 5971
} | 176 |
# Constitutional chain
This example shows the Self-critique chain with `Constitutional AI`.
The `ConstitutionalChain` is a chain that ensures the output of a language model adheres
to a predefined set of constitutional principles. By incorporating specific rules and guidelines,
the `ConstitutionalChain` filters and... | langchain/docs/docs/guides/safety/constitutional_chain.mdx/0 | {
"file_path": "langchain/docs/docs/guides/safety/constitutional_chain.mdx",
"repo_id": "langchain",
"token_count": 4865
} | 96 |
"""Utility for using SearxNG meta search API.
SearxNG is a privacy-friendly free metasearch engine that aggregates results from
`multiple search engines
<https://docs.searxng.org/admin/engines/configured_engines.html>`_ and databases and
supports the `OpenSearch
<https://github.com/dewitt/opensearch/blob/master/opense... | langchain/libs/community/langchain_community/utilities/searx_search.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/searx_search.py",
"repo_id": "langchain",
"token_count": 7140
} | 319 |
# coding=utf-8
# Copyright 2023 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/code_llama/tokenization_code_llama_fast.py/0 | {
"file_path": "transformers/src/transformers/models/code_llama/tokenization_code_llama_fast.py",
"repo_id": "transformers",
"token_count": 8207
} | 621 |
# 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/tokenization_mpnet.py/0 | {
"file_path": "transformers/src/transformers/models/mpnet/tokenization_mpnet.py",
"repo_id": "transformers",
"token_count": 9997
} | 634 |
import json
from typing import Sequence
from llama_index.core.prompts.base import PromptTemplate
from llama_index.core.question_gen.types import SubQuestion
from llama_index.core.tools.types import ToolMetadata
# deprecated, kept for backward compatibility
SubQuestionPrompt = PromptTemplate
def build_tools_text(too... | llama_index/llama-index-core/llama_index/core/question_gen/prompts.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/question_gen/prompts.py",
"repo_id": "llama_index",
"token_count": 715
} | 1,199 |
# 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/src/transformers/models/roformer/configuration_roformer.py/0 | {
"file_path": "transformers/src/transformers/models/roformer/configuration_roformer.py",
"repo_id": "transformers",
"token_count": 2947
} | 725 |
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
| opengpts/frontend/postcss.config.js/0 | {
"file_path": "opengpts/frontend/postcss.config.js",
"repo_id": "opengpts",
"token_count": 35
} | 1,997 |
// 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/storage/print_binlog.go/0 | {
"file_path": "milvus/internal/storage/print_binlog.go",
"repo_id": "milvus",
"token_count": 5851
} | 1,795 |
import logging
import uuid
from abc import ABC
from collections import defaultdict
from contextlib import contextmanager
from contextvars import ContextVar
from typing import Any, Dict, Generator, List, Optional, cast
from llama_index.core.callbacks.base_handler import BaseCallbackHandler
from llama_index.core.callbac... | llama_index/llama-index-core/llama_index/core/callbacks/base.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/callbacks/base.py",
"repo_id": "llama_index",
"token_count": 4550
} | 1,200 |
// 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/rootcoord/name_db.go/0 | {
"file_path": "milvus/internal/rootcoord/name_db.go",
"repo_id": "milvus",
"token_count": 1341
} | 1,883 |
import logging
from typing import List
from tests.integration_tests.vectorstores.qdrant.common import qdrant_is_not_running
logger = logging.getLogger(__name__)
def qdrant_locations() -> List[str]:
if qdrant_is_not_running():
logger.warning("Running Qdrant async tests in memory mode only.")
retu... | langchain/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/fixtures.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/qdrant/async_api/fixtures.py",
"repo_id": "langchain",
"token_count": 136
} | 356 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
API_URL_PROMPT_TEMPLATE = """You are given the below API Documentation:
{api_docs}
Using this documentation, generate the full API url to call for answering the user question.
You should build the API url in order to get a response that is as shor... | langchain/libs/langchain/langchain/chains/api/prompt.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/api/prompt.py",
"repo_id": "langchain",
"token_count": 351
} | 455 |
# Anthropic
All functionality related to Anthropic models.
[Anthropic](https://www.anthropic.com/) is an AI safety and research company, and is the creator of Claude.
This page covers all integrations between Anthropic models and LangChain.
## Prompting Overview
Claude is chat-based model, meaning it is trained on ... | langchain/docs/docs/integrations/platforms/anthropic.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/platforms/anthropic.mdx",
"repo_id": "langchain",
"token_count": 1803
} | 126 |
from llama_index.core.storage.kvstore.simple_kvstore import SimpleKVStore
__all__ = ["FirestoreKVStore", "SimpleKVStore", "MongoDBKVStore", "RedisKVStore"]
| llama_index/llama-index-core/llama_index/core/storage/kvstore/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/storage/kvstore/__init__.py",
"repo_id": "llama_index",
"token_count": 59
} | 1,301 |
import asyncio
import os
import shutil
import tempfile
import pytest
from itertools import count
from typing import (
Generator,
List,
Callable,
Optional,
Dict,
Union,
Iterator,
Sequence,
Tuple,
)
from chromadb.ingest import Producer, Consumer
from chromadb.db.impl.sqlite import Sqli... | chroma/chromadb/test/ingest/test_producer_consumer.py/0 | {
"file_path": "chroma/chromadb/test/ingest/test_producer_consumer.py",
"repo_id": "chroma",
"token_count": 5455
} | 24 |
# coding=utf-8
# Copyright 2018 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/convert_slow_tokenizer.py/0 | {
"file_path": "transformers/src/transformers/convert_slow_tokenizer.py",
"repo_id": "transformers",
"token_count": 24715
} | 604 |
/* eslint-disable no-promise-executor-return */
import { test } from "@jest/globals";
import { Cohere } from "../llms.js";
test("test invoke", async () => {
const cohere = new Cohere({});
const result = await cohere.invoke(
"What is a good name for a company that makes colorful socks?"
);
console.log({ res... | langchainjs/libs/langchain-cohere/src/tests/llms.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-cohere/src/tests/llms.int.test.ts",
"repo_id": "langchainjs",
"token_count": 477
} | 958 |
import {
MemorySearchPayload,
MemorySearchResult,
NotFoundError,
ZepClient,
} from "@getzep/zep-js";
import { BaseRetriever, BaseRetrieverInput } from "@langchain/core/retrievers";
import { Document } from "@langchain/core/documents";
/**
* Configuration interface for the ZepRetriever class. Extends the
* Ba... | langchainjs/libs/langchain-community/src/retrievers/zep.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/retrievers/zep.ts",
"repo_id": "langchainjs",
"token_count": 1917
} | 953 |
// 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/distributed/proxy/client/client.go/0 | {
"file_path": "milvus/internal/distributed/proxy/client/client.go",
"repo_id": "milvus",
"token_count": 2886
} | 1,714 |
from langchain_community.chat_models.google_palm import (
ChatGooglePalm,
ChatGooglePalmError,
)
__all__ = ["ChatGooglePalm", "ChatGooglePalmError"]
| langchain/libs/langchain/langchain/chat_models/google_palm.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chat_models/google_palm.py",
"repo_id": "langchain",
"token_count": 57
} | 495 |
#include <sstream>
#include <fmt/format.h>
#include "tantivy-binding.h"
namespace milvus::tantivy {
struct RustArrayWrapper {
explicit RustArrayWrapper(RustArray array) : array_(array) {
}
RustArrayWrapper(RustArrayWrapper&) = delete;
RustArrayWrapper&
operator=(RustArrayWrapper&) = delete;
R... | milvus/internal/core/thirdparty/tantivy/tantivy-wrapper.h/0 | {
"file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-wrapper.h",
"repo_id": "milvus",
"token_count": 5756
} | 1,763 |
import json
from typing import Any, Dict, Optional, Tuple
from llama_index.core.schema import (
BaseNode,
ImageNode,
IndexNode,
NodeRelationship,
RelatedNodeInfo,
TextNode,
)
DEFAULT_TEXT_KEY = "text"
DEFAULT_EMBEDDING_KEY = "embedding"
DEFAULT_DOC_ID_KEY = "doc_id"
def _validate_is_flat_dic... | llama_index/llama-index-core/llama_index/core/vector_stores/utils.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/vector_stores/utils.py",
"repo_id": "llama_index",
"token_count": 1750
} | 1,213 |
from langchain_core.agents import AgentAction, AgentFinish
from langchain.agents.output_parsers.react_json_single_input import (
ReActJsonSingleInputOutputParser,
)
def test_action() -> None:
"""Test standard parsing of action/action input."""
parser = ReActJsonSingleInputOutputParser()
_input = """T... | langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_react_json_single_input.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_react_json_single_input.py",
"repo_id": "langchain",
"token_count": 335
} | 587 |
<!---
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 ... | transformers/docs/source/ja/pr_checks.md/0 | {
"file_path": "transformers/docs/source/ja/pr_checks.md",
"repo_id": "transformers",
"token_count": 5982
} | 534 |
---
sidebar_position: 1
---
# HTTP Response Output Parser
import CodeBlock from "@theme/CodeBlock";
import HttpResponse from "@examples/prompts/http_response_output_parser.ts";
import EventStreamHttpResponse from "@examples/prompts/http_response_output_parser_event_stream.ts";
import CustomOutputHttpResponse from "@e... | langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/http_response.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/http_response.mdx",
"repo_id": "langchainjs",
"token_count": 349
} | 819 |
from langchain_core.utils import __all__
EXPECTED_ALL = [
"StrictFormatter",
"check_package_version",
"convert_to_secret_str",
"formatter",
"get_bolded_text",
"get_color_mapping",
"get_colored_text",
"get_pydantic_field_names",
"guard_import",
"mock_now",
"print_text",
"... | langchain/libs/core/tests/unit_tests/utils/test_imports.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/utils/test_imports.py",
"repo_id": "langchain",
"token_count": 290
} | 422 |
import multiprocessing
import os
from typing import BinaryIO, Optional, Union
import fsspec
from .. import Dataset, Features, NamedSplit, config
from ..formatting import query_table
from ..packaged_modules.json.json import Json
from ..utils import tqdm as hf_tqdm
from ..utils.typing import NestedDataStructureLike, Pa... | datasets/src/datasets/io/json.py/0 | {
"file_path": "datasets/src/datasets/io/json.py",
"repo_id": "datasets",
"token_count": 2940
} | 132 |
# coding=utf-8
# 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 requir... | transformers/tests/models/xglm/test_modeling_tf_xglm.py/0 | {
"file_path": "transformers/tests/models/xglm/test_modeling_tf_xglm.py",
"repo_id": "transformers",
"token_count": 4033
} | 781 |
from langchain_google_vertexai._enums import HarmBlockThreshold, HarmCategory
from langchain_google_vertexai.chains import create_structured_runnable
from langchain_google_vertexai.chat_models import ChatVertexAI
from langchain_google_vertexai.embeddings import VertexAIEmbeddings
from langchain_google_vertexai.function... | langchain/libs/partners/google-vertexai/langchain_google_vertexai/__init__.py/0 | {
"file_path": "langchain/libs/partners/google-vertexai/langchain_google_vertexai/__init__.py",
"repo_id": "langchain",
"token_count": 234
} | 627 |
from langchain_community.embeddings.octoai_embeddings import (
OctoAIEmbeddings,
)
__all__ = ["OctoAIEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/octoai_embeddings.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/octoai_embeddings.py",
"repo_id": "langchain",
"token_count": 49
} | 509 |
<jupyter_start><jupyter_text>Zep Retriever Example for [Zep](https://docs.getzep.com/) Fast, Scalable Building Blocks for LLM AppsZep is an open source platform for productionizing LLM apps. Go from a prototypebuilt in LangChain or LlamaIndex, or a custom app, to production in minutes withoutrewriting code.Key Features... | langchain/docs/docs/integrations/retrievers/zep_memorystore.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/zep_memorystore.ipynb",
"repo_id": "langchain",
"token_count": 3604
} | 160 |
"""Voyage embeddings file."""
from typing import Any, List, Optional
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.bridge.pydantic import PrivateAttr
from llama_index.core.callbacks.base import CallbackManager
import voyageai
DEFAULT_VOYAGE_BATCH_SIZE = 8
class VoyageEmbedd... | llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py",
"repo_id": "llama_index",
"token_count": 1428
} | 1,239 |
<jupyter_start><jupyter_text>Chat HistoryAn example of a client interacting with a chatbot where message history is persisted on the backend.<jupyter_code>import uuid
from langserve import RemoteRunnable
chat = RemoteRunnable("http://localhost:8000/")<jupyter_output><empty_output><jupyter_text>Let's create a prompt co... | langserve/examples/chat_with_persistence/client.ipynb/0 | {
"file_path": "langserve/examples/chat_with_persistence/client.ipynb",
"repo_id": "langserve",
"token_count": 1120
} | 1,041 |
[package]
name = "candle-wasm-example-yolo"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
[dependencies]
candle = { workspace = true }
candle-nn = { workspace = true }
num-traits ... | candle/candle-wasm-examples/yolo/Cargo.toml/0 | {
"file_path": "candle/candle-wasm-examples/yolo/Cargo.toml",
"repo_id": "candle",
"token_count": 463
} | 89 |
<jupyter_start><jupyter_text>MultiVector RetrieverIt can often be beneficial to store multiple vectors per document. There are multiple use cases where this is beneficial. LangChain has a base `MultiVectorRetriever` which makes querying this type of setup easy. A lot of the complexity lies in how to create the multiple... | langchain/docs/docs/modules/data_connection/retrievers/multi_vector.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/data_connection/retrievers/multi_vector.ipynb",
"repo_id": "langchain",
"token_count": 2517
} | 200 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.