text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
"""MultiOn Toolkit."""
| langchain/libs/langchain/langchain/agents/agent_toolkits/multion/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/multion/__init__.py",
"repo_id": "langchain",
"token_count": 8
} | 439 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/falcon/test_modeling_falcon.py/0 | {
"file_path": "transformers/tests/models/falcon/test_modeling_falcon.py",
"repo_id": "transformers",
"token_count": 11320
} | 723 |
<jupyter_start><jupyter_text>DuckDB>[DuckDB](https://duckdb.org/) is an in-process SQL OLAP database management system.Load a `DuckDB` query with one document per row.<jupyter_code>%pip install --upgrade --quiet duckdb
from langchain_community.document_loaders import DuckDBLoader
%%file example.csv
Team,Payroll
Nation... | langchain/docs/docs/integrations/document_loaders/duckdb.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/duckdb.ipynb",
"repo_id": "langchain",
"token_count": 501
} | 101 |
# pii-protected-chatbot
This template creates a chatbot that flags any incoming PII and doesn't pass it to the LLM.
## Environment Setup
The following environment variables need to be set:
Set the `OPENAI_API_KEY` environment variable to access the OpenAI models.
## Usage
To use this package, you should first hav... | langchain/templates/pii-protected-chatbot/README.md/0 | {
"file_path": "langchain/templates/pii-protected-chatbot/README.md",
"repo_id": "langchain",
"token_count": 622
} | 720 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | transformers/examples/research_projects/movement-pruning/emmental/configuration_bert_masked.py/0 | {
"file_path": "transformers/examples/research_projects/movement-pruning/emmental/configuration_bert_masked.py",
"repo_id": "transformers",
"token_count": 995
} | 566 |
import asyncio
from functools import partial
from typing import Any, Dict, List, Optional, Type
from langchain_core.callbacks.manager import (
AsyncCallbackManagerForToolRun,
CallbackManagerForToolRun,
)
from langchain_core.pydantic_v1 import BaseModel, Field, create_model, root_validator
from langchain_core.t... | langchain/libs/community/langchain_community/tools/connery/tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/connery/tool.py",
"repo_id": "langchain",
"token_count": 2275
} | 294 |
import { test } from "@jest/globals";
import { OpenAI, OpenAIEmbeddings } from "@langchain/openai";
import { PromptTemplate } from "@langchain/core/prompts";
import { Document } from "@langchain/core/documents";
import { LLMChain } from "../llm_chain.js";
import { StuffDocumentsChain } from "../combine_docs_chain.js";
... | langchainjs/langchain/src/chains/tests/vector_db_qa_chain.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/tests/vector_db_qa_chain.int.test.ts",
"repo_id": "langchainjs",
"token_count": 828
} | 934 |
from typing import List, Optional
from llama_index.legacy.bridge.pydantic import Field
from llama_index.legacy.postprocessor.types import BaseNodePostprocessor
from llama_index.legacy.schema import MetadataMode, NodeWithScore, QueryBundle
class MetadataReplacementPostProcessor(BaseNodePostprocessor):
target_meta... | llama_index/llama-index-legacy/llama_index/legacy/postprocessor/metadata_replacement.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/postprocessor/metadata_replacement.py",
"repo_id": "llama_index",
"token_count": 446
} | 1,626 |
<jupyter_start><jupyter_text>Activeloop Deep Memory >[Activeloop Deep Memory](https://docs.activeloop.ai/performance-features/deep-memory) is a suite of tools that enables you to optimize your Vector Store for your use-case and achieve higher accuracy in your LLM apps.`Retrieval-Augmented Generatation` (`RAG`) has rece... | langchain/docs/docs/integrations/retrievers/activeloop.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/activeloop.ipynb",
"repo_id": "langchain",
"token_count": 4608
} | 154 |
python_sources()
| llama_index/llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,562 |
"""Index registry."""
from typing import Dict, Type
from llama_index.core.data_structs.struct_type import IndexStructType
from llama_index.core.indices.base import BaseIndex
from llama_index.core.indices.document_summary.base import DocumentSummaryIndex
from llama_index.core.indices.empty.base import EmptyIndex
from ... | llama_index/llama-index-core/llama_index/core/indices/registry.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/registry.py",
"repo_id": "llama_index",
"token_count": 467
} | 1,181 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "callbacks/handlers/llmonitor",
newEntrypointName: "callbacks/handlers/llmonitor",
});
export * from "@langchain/community/callbacks/handlers/llmonitor";
| langchainjs/langchain/src/callbacks/handlers/llmonitor.ts/0 | {
"file_path": "langchainjs/langchain/src/callbacks/handlers/llmonitor.ts",
"repo_id": "langchainjs",
"token_count": 96
} | 951 |
<jupyter_start><jupyter_text>Comet TracingThere are two ways to trace your LangChains executions with Comet:1. Setting the `LANGCHAIN_COMET_TRACING` environment variable to "true". This is the recommended way.2. Import the `CometTracer` manually and pass it explicitely.<jupyter_code>import os
import comet_llm
os.envi... | langchain/docs/docs/integrations/callbacks/comet_tracing.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/callbacks/comet_tracing.ipynb",
"repo_id": "langchain",
"token_count": 641
} | 95 |
from typing import Any, Dict, List, Mapping, Optional
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Field, SecretStr
class Predibase(LLM):
"""Use your Predibase models with Langchain.
To use, you shoul... | langchain/libs/community/langchain_community/llms/predibase.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/predibase.py",
"repo_id": "langchain",
"token_count": 661
} | 285 |
<!--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... | peft/docs/source/package_reference/prefix_tuning.md/0 | {
"file_path": "peft/docs/source/package_reference/prefix_tuning.md",
"repo_id": "peft",
"token_count": 514
} | 322 |
// 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/kv/mem/mem_kv.go/0 | {
"file_path": "milvus/internal/kv/mem/mem_kv.go",
"repo_id": "milvus",
"token_count": 3769
} | 1,722 |
# coding=utf-8
# Copyright 2018 The Microsoft Research Asia LayoutLM Team Authors and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | transformers/src/transformers/models/layoutlm/modeling_layoutlm.py/0 | {
"file_path": "transformers/src/transformers/models/layoutlm/modeling_layoutlm.py",
"repo_id": "transformers",
"token_count": 26116
} | 619 |
## 3. Index Service
#### 3.1 Overview
<img src="./figs/index_coord.png" width=700>
#### 3.2 Index Service Interface
```go
type IndexCoord interface {
Component
// TimeTickProvider is the interface all services implement
TimeTickProvider
// BuildIndex receives requests from RootCoordinator to build an index.
... | milvus/docs/developer_guides/chap03_index_service.md/0 | {
"file_path": "milvus/docs/developer_guides/chap03_index_service.md",
"repo_id": "milvus",
"token_count": 1533
} | 1,856 |
<jupyter_start><jupyter_text>Replicate>[Replicate](https://replicate.com/blog/machine-learning-needs-better-tools) runs machine learning models in the cloud. We have a library of open-source models that you can run with a few lines of code. If you're building your own machine learning models, Replicate makes it easy to... | langchain/docs/docs/integrations/llms/replicate.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/replicate.ipynb",
"repo_id": "langchain",
"token_count": 2892
} | 130 |
import grpc
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.instrumentation.grpc._aio_server import (
OpenTelemetryAioServerInterceptor,
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.sdk.resources im... | text-generation-inference/server/text_generation_server/tracing.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/tracing.py",
"repo_id": "text-generation-inference",
"token_count": 985
} | 419 |
import json
from typing import Any, AsyncIterator, Dict, Iterator, List, Optional, Union, cast
from langchain_core._api import deprecated
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain_core.language_models.chat_models import BaseChatModel
from l... | langchain/libs/community/langchain_community/chat_models/ollama.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_models/ollama.py",
"repo_id": "langchain",
"token_count": 6428
} | 222 |
from llama_index.llms.bedrock.base import (
Bedrock,
completion_response_to_chat_response,
completion_with_retry,
)
__all__ = ["Bedrock", "completion_with_retry", "completion_response_to_chat_response"]
| llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/__init__.py",
"repo_id": "llama_index",
"token_count": 81
} | 1,390 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import {
BaseChatMemory,
BaseChatMemoryInput,
} from "@langchain/community/memory/chat_memory";
import { PromptTemplate } from "@langchain/core/prompts";
import {
InputValues,
MemoryVariables,
OutputValues,
getPromptInp... | langchainjs/langchain/src/memory/entity_memory.ts/0 | {
"file_path": "langchainjs/langchain/src/memory/entity_memory.ts",
"repo_id": "langchainjs",
"token_count": 2188
} | 933 |
<jupyter_start><jupyter_text>Supabase Vector StoreIn this notebook we are going to show how to use [Vecs](https://supabase.github.io/vecs/) to perform vector searches in LlamaIndex. See [this guide](https://supabase.github.io/vecs/hosting/) for instructions on hosting a database on Supabase If you're opening this Not... | llama_index/docs/examples/vector_stores/SupabaseVectorIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/SupabaseVectorIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1748
} | 1,149 |
poetry_requirements(
name="poetry",
module_mapping={"google-cloud-aiplatform": ["vertexai"]}
)
python_sources(
interpreter_constraints=["==3.9.*", "==3.10.*"],
)
| llama_index/llama-index-integrations/llms/llama-index-llms-vertex/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vertex/BUILD",
"repo_id": "llama_index",
"token_count": 78
} | 1,318 |
# Writer
LangChain.js supports calling [Writer](https://writer.com/) LLMs.
## Setup
First, you'll need to sign up for an account at https://writer.com/. Create a service account and note your API key.
Next, you'll need to install the official package as a peer dependency:
```bash npm2yarn
yarn add @writerai/writer... | langchainjs/docs/core_docs/docs/integrations/llms/writer.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/llms/writer.mdx",
"repo_id": "langchainjs",
"token_count": 214
} | 708 |
<jupyter_start><jupyter_text>Nebula Graph Store<jupyter_code>%pip install llama-index-llms-openai
%pip install llama-index-embeddings-openai
%pip install llama-index-graph-stores-nebula
%pip install llama-index-llms-azure-openai
# For OpenAI
import os
os.environ["OPENAI_API_KEY"] = "INSERT OPENAI KEY"
import logging... | llama_index/docs/examples/index_structs/knowledge_graph/NebulaGraphKGIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/index_structs/knowledge_graph/NebulaGraphKGIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 2871
} | 1,122 |
# Add message history (memory)
The `RunnableWithMessageHistory` let's us add message history to certain types of chains.
Specifically, it can be used for any Runnable that takes as input one of
- a sequence of `BaseMessage`
- a dict with a key that takes a sequence of `BaseMessage`
- a dict with a key that takes the... | langchainjs/docs/core_docs/docs/expression_language/how_to/message_history.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/expression_language/how_to/message_history.mdx",
"repo_id": "langchainjs",
"token_count": 2409
} | 693 |
[package]
name = "unstable_wasm"
version = "0.1.0"
authors = ["Nicolas Patry"]
edition = "2018"
[lib]
crate-type = ["cdylib", "rlib"]
[features]
default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = "0.2.63"
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them ... | tokenizers/tokenizers/examples/unstable_wasm/Cargo.toml/0 | {
"file_path": "tokenizers/tokenizers/examples/unstable_wasm/Cargo.toml",
"repo_id": "tokenizers",
"token_count": 364
} | 427 |
from langchain_community.document_loaders.url import UnstructuredURLLoader
__all__ = ["UnstructuredURLLoader"]
| langchain/libs/langchain/langchain/document_loaders/url.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/url.py",
"repo_id": "langchain",
"token_count": 36
} | 492 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/using-diffusers/img2img.md/0 | {
"file_path": "diffusers/docs/source/en/using-diffusers/img2img.md",
"repo_id": "diffusers",
"token_count": 9649
} | 185 |
"""Test memory functionality."""
from langchain.memory.summary_buffer import ConversationSummaryBufferMemory
from tests.unit_tests.llms.fake_llm import FakeLLM
def test_summary_buffer_memory_no_buffer_yet() -> None:
"""Test ConversationSummaryBufferMemory when no inputs put in buffer yet."""
memory = Conversa... | langchain/libs/langchain/tests/integration_tests/chains/test_memory.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/chains/test_memory.py",
"repo_id": "langchain",
"token_count": 458
} | 592 |
<jupyter_start><jupyter_text>Kùzu Graph StoreThis notebook walks through configuring `Kùzu` to be the backend for graph storage in LlamaIndex.<jupyter_code>%pip install llama-index-llms-openai
%pip install llama-index-graph-stores-kuzu
# My OpenAI Key
import os
os.environ["OPENAI_API_KEY"] = "API_KEY_HERE"
import logg... | llama_index/docs/examples/index_structs/knowledge_graph/KuzuGraphDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/index_structs/knowledge_graph/KuzuGraphDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1936
} | 1,140 |
# OpenAI functions metadata tagger
It can often be useful to tag ingested documents with structured metadata, such as the title, tone, or length of a document, to allow for more targeted similarity search later. However, for large numbers of documents, performing this labelling process manually can be tedious.
The `M... | langchainjs/docs/core_docs/docs/integrations/document_transformers/openai_metadata_tagger.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_transformers/openai_metadata_tagger.mdx",
"repo_id": "langchainjs",
"token_count": 439
} | 706 |
// 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/storage/PayloadWriter.cpp/0 | {
"file_path": "milvus/internal/core/src/storage/PayloadWriter.cpp",
"repo_id": "milvus",
"token_count": 1547
} | 1,774 |
from typing import Any, Callable, List, Mapping, Optional
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Field
from langchain_community.llms.utils import enforce_stop_tokens
def _display_prompt(prompt: str) -> ... | langchain/libs/community/langchain_community/llms/human.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/human.py",
"repo_id": "langchain",
"token_count": 1055
} | 288 |
import base64
import hashlib
import hmac
import json
import logging
import queue
import threading
from datetime import datetime
from queue import Queue
from time import mktime
from typing import Any, Dict, Generator, Iterator, List, Mapping, Optional, Type
from urllib.parse import urlencode, urlparse, urlunparse
from w... | langchain/libs/community/langchain_community/chat_models/sparkllm.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_models/sparkllm.py",
"repo_id": "langchain",
"token_count": 7640
} | 238 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/owlv2/image_processing_owlv2.py/0 | {
"file_path": "transformers/src/transformers/models/owlv2/image_processing_owlv2.py",
"repo_id": "transformers",
"token_count": 11225
} | 703 |
from langchain_core.example_selectors import __all__
EXPECTED_ALL = [
"BaseExampleSelector",
"LengthBasedExampleSelector",
"MaxMarginalRelevanceExampleSelector",
"SemanticSimilarityExampleSelector",
"sorted_values",
]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain/libs/core/tests/unit_tests/example_selectors/test_imports.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/example_selectors/test_imports.py",
"repo_id": "langchain",
"token_count": 117
} | 413 |
[tool.poetry]
name = "extraction-anthropic-functions"
version = "0.1.0"
description = "Use Anthropic function calling for tasks like extraction or tagging"
authors = [
"Lance Martin <lance@langchain.dev>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
anthropic = ">=0... | langchain/templates/extraction-anthropic-functions/pyproject.toml/0 | {
"file_path": "langchain/templates/extraction-anthropic-functions/pyproject.toml",
"repo_id": "langchain",
"token_count": 317
} | 690 |
"""Integration test for JIRA API Wrapper."""
from langchain_community.utilities.jira import JiraAPIWrapper
def test_search() -> None:
"""Test for Searching issues on JIRA"""
jql = "project = TP"
jira = JiraAPIWrapper()
output = jira.run("jql", jql)
assert "issues" in output
def test_getprojects(... | langchain/libs/community/tests/integration_tests/utilities/test_jira_api.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/utilities/test_jira_api.py",
"repo_id": "langchain",
"token_count": 814
} | 351 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/wuerstchen.md/0 | {
"file_path": "diffusers/docs/source/en/training/wuerstchen.md",
"repo_id": "diffusers",
"token_count": 2904
} | 188 |
import torch
from diffusers import HeunDiscreteScheduler
from diffusers.utils.testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class HeunDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (HeunDiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_... | diffusers/tests/schedulers/test_scheduler_heun.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_heun.py",
"repo_id": "diffusers",
"token_count": 3279
} | 261 |
# LlamaIndex Question_Gen Integration: Openai Generator
| llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/README.md",
"repo_id": "llama_index",
"token_count": 13
} | 1,445 |
// 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/allocator/global_id_allocator.go/0 | {
"file_path": "milvus/internal/allocator/global_id_allocator.go",
"repo_id": "milvus",
"token_count": 714
} | 1,719 |
import warnings
from typing import Any, Callable, Dict, Optional, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
MessageRole... | llama_index/llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/base.py",
"repo_id": "llama_index",
"token_count": 5491
} | 1,348 |
"""Callback Handler that writes to a file."""
from typing import Any, Dict, Optional, TextIO, cast
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.utils.input import print_text
class FileCallbackHandler(BaseCallbackHandler):
... | langchain/libs/langchain/langchain/callbacks/file.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/file.py",
"repo_id": "langchain",
"token_count": 1084
} | 493 |
import { test, expect } from "@jest/globals";
import fs from "node:fs/promises";
import path from "node:path";
import * as os from "node:os";
import { OpenAI, ChatOpenAI } from "@langchain/openai";
import { LocalFileCache } from "../file_system.js";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let ... | langchainjs/langchain/src/cache/tests/file_system.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/cache/tests/file_system.int.test.ts",
"repo_id": "langchainjs",
"token_count": 442
} | 887 |
# 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... | transformers/src/transformers/models/depth_anything/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/depth_anything/__init__.py",
"repo_id": "transformers",
"token_count": 645
} | 674 |
<jupyter_start><jupyter_text>PsychicThis notebook covers how to load documents from `Psychic`. See [here](/docs/integrations/providers/psychic) for more details. Prerequisites1. Follow the Quick Start section in [this document](/docs/integrations/providers/psychic)2. Log into the [Psychic dashboard](https://dashboard.p... | langchain/docs/docs/integrations/document_loaders/psychic.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/psychic.ipynb",
"repo_id": "langchain",
"token_count": 652
} | 108 |
package syncmgr
import (
"testing"
"github.com/cockroachdb/errors"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"github.com/milvus-io/milvus/internal/datanode/broker"
"github.com/milvus-io/milvus/internal/datanode/metacache"
"github.com/milvus-io/milvus/internal/proto/datapb"
"githu... | milvus/internal/datanode/syncmgr/meta_writer_test.go/0 | {
"file_path": "milvus/internal/datanode/syncmgr/meta_writer_test.go",
"repo_id": "milvus",
"token_count": 1291
} | 1,925 |
[tool.poetry]
name = "rag-elasticsearch"
version = "0.0.1"
description = "RAG using Elasticsearch"
authors = [
"Joe McElroy <joseph.mcelroy@elastic.co>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
langchain = "^0.1"
openai = "<2"
elasticsearch = "^8.10.0"
sentence-transformers = "^2.2... | langchain/templates/rag-elasticsearch/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-elasticsearch/pyproject.toml",
"repo_id": "langchain",
"token_count": 318
} | 680 |
from langchain_community.document_loaders.mongodb import MongodbLoader
__all__ = ["MongodbLoader"]
| langchain/libs/langchain/langchain/document_loaders/mongodb.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/mongodb.py",
"repo_id": "langchain",
"token_count": 33
} | 510 |
<jupyter_start><jupyter_text>Correctness Evaluator This notebook uses the `CorrectnessEvaluator` to evaluate the relevance and correctness of a generated answer against a reference answer. If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-ll... | llama_index/docs/examples/evaluation/correctness_eval.ipynb/0 | {
"file_path": "llama_index/docs/examples/evaluation/correctness_eval.ipynb",
"repo_id": "llama_index",
"token_count": 770
} | 1,081 |
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env"],
"pipeline": {
"@langchain/scripts#build": {
"outputs": [
"./libs/langchain-scripts/dist/**",
"*.js",
"*.cjs",
"*.d.ts"
],
"inputs": [
"./libs/langchain-scripts/src/",
... | langchainjs/turbo.json/0 | {
"file_path": "langchainjs/turbo.json",
"repo_id": "langchainjs",
"token_count": 1343
} | 1,026 |
<jupyter_start><jupyter_text>Self DiscoverAn implementation of the [Self-Discover paper](https://arxiv.org/pdf/2402.03620.pdf).Based on [this implementation from @catid](https://github.com/catid/self-discover/tree/main?tab=readme-ov-file)<jupyter_code>from langchain_openai import ChatOpenAI
model = ChatOpenAI(temperatu... | langchain/cookbook/self-discover.ipynb/0 | {
"file_path": "langchain/cookbook/self-discover.ipynb",
"repo_id": "langchain",
"token_count": 1841
} | 76 |
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { ChatOpenAI } from "@langchain/openai";
import { JsonOutputToolsParser } from "langchain/output_parsers";
import { ChatPromptTemplate } from "@langchain/core/prompts";
const EXTRACTION_TEMPLATE = `Extract and save the relevant entit... | langchainjs/examples/src/extraction/openai_tool_calling_extraction.ts/0 | {
"file_path": "langchainjs/examples/src/extraction/openai_tool_calling_extraction.ts",
"repo_id": "langchainjs",
"token_count": 484
} | 815 |
// 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/retry/retry.go/0 | {
"file_path": "milvus/pkg/util/retry/retry.go",
"repo_id": "milvus",
"token_count": 929
} | 1,915 |
<jupyter_start><jupyter_text>Faiss>[Facebook AI Similarity Search (Faiss)](https://engineering.fb.com/2017/03/29/data-infrastructure/faiss-a-library-for-efficient-similarity-search/) is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of an... | langchain/docs/docs/integrations/vectorstores/faiss.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/faiss.ipynb",
"repo_id": "langchain",
"token_count": 3100
} | 194 |
"""Vector store index types."""
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from typing import (
Any,
Dict,
List,
Optional,
Protocol,
Sequence,
Union,
runtime_checkable,
)
import fsspec
from deprecated import deprecated
from llama_index.co... | llama_index/llama-index-core/llama_index/core/vector_stores/types.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/vector_stores/types.py",
"repo_id": "llama_index",
"token_count": 4040
} | 1,223 |
"""
**LLM** classes provide
access to the large language model (**LLM**) APIs and services.
**Class hierarchy:**
.. code-block::
BaseLanguageModel --> BaseLLM --> LLM --> <name> # Examples: AI21, HuggingFaceHub, OpenAI
**Main helpers:**
.. code-block::
LLMResult, PromptValue,
CallbackManagerForLLMRun... | langchain/libs/community/langchain_community/llms/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/__init__.py",
"repo_id": "langchain",
"token_count": 10068
} | 264 |
from langchain_community.storage.exceptions import InvalidKeyException
__all__ = ["InvalidKeyException"]
| langchain/libs/langchain/langchain/storage/exceptions.py/0 | {
"file_path": "langchain/libs/langchain/langchain/storage/exceptions.py",
"repo_id": "langchain",
"token_count": 26
} | 548 |
"""Test finetuning engine."""
# def test_torch_imports() -> None:
# """Test that torch is an optional dependency."""
# # importing fine-tuning modules should be ok
# from llama_index.legacy.finetuning import OpenAIFinetuneEngine
#
# # if torch isn't installed, then these should fail
# if pkgutil.fi... | llama_index/llama-index-legacy/tests/finetuning/test_base.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/finetuning/test_base.py",
"repo_id": "llama_index",
"token_count": 195
} | 1,732 |
---
sidebar_class_name: node-only
---
import CodeBlock from "@theme/CodeBlock";
# MyScale
:::tip Compatibility
Only available on Node.js.
:::
[MyScale](https://myscale.com/) is an emerging AI database that harmonizes the power of vector search and SQL analytics, providing a managed, efficient, and responsive experi... | langchainjs/docs/core_docs/docs/integrations/vectorstores/myscale.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/myscale.mdx",
"repo_id": "langchainjs",
"token_count": 383
} | 729 |
# coding=utf-8
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
# original forms to accommodate minor architectural differences compared
# to G... | text-generation-inference/server/text_generation_server/models/custom_modeling/flash_llama_modeling.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_llama_modeling.py",
"repo_id": "text-generation-inference",
"token_count": 7080
} | 395 |
<jupyter_start><jupyter_text>Bearly Code Interpreter> Bearly Code Interpreter allows for remote execution of code. This makes it perfect for a code sandbox for agents, to allow for safe implementation of things like Code InterpreterGet your api key here: https://bearly.ai/dashboard/developers In this notebook, we will ... | langchain/docs/docs/integrations/tools/bearly.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/bearly.ipynb",
"repo_id": "langchain",
"token_count": 1315
} | 181 |
import type { BaseLLMParams } from "@langchain/core/language_models/llms";
import type { JsonStream } from "./utils/stream.js";
/**
* Parameters needed to setup the client connection.
* AuthOptions are something like GoogleAuthOptions (from google-auth-library)
* or WebGoogleAuthOptions.
*/
export interface Google... | langchainjs/libs/langchain-google-common/src/types.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-common/src/types.ts",
"repo_id": "langchainjs",
"token_count": 1382
} | 1,026 |
package storage
import (
"encoding/json"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
)
func TestVarCharPrimaryKey(t *testing.T) {
pk := NewVarCharPrimaryKey("milvus")
testPk := NewVarCharPrimaryKey("milvus")
// test GE
assert.Equal(t, true, pk.GE(t... | milvus/internal/storage/primary_key_test.go/0 | {
"file_path": "milvus/internal/storage/primary_key_test.go",
"repo_id": "milvus",
"token_count": 1863
} | 1,891 |
# Run inside root directory of official source code: https://github.com/dome272/wuerstchen/
import os
import torch
from transformers import AutoTokenizer, CLIPTextModel
from vqgan import VQModel
from diffusers import (
DDPMWuerstchenScheduler,
WuerstchenCombinedPipeline,
WuerstchenDecoderPipeline,
Wue... | diffusers/scripts/convert_wuerstchen.py/0 | {
"file_path": "diffusers/scripts/convert_wuerstchen.py",
"repo_id": "diffusers",
"token_count": 2171
} | 225 |
import { HandlebarsPromptTemplate } from "langchain/experimental/prompts/handlebars";
import { ChatAnthropic } from "@langchain/anthropic";
import { StringOutputParser } from "@langchain/core/output_parsers";
const template = `Tell me a joke about {{topic}}`;
const prompt = HandlebarsPromptTemplate.fromTemplate(templ... | langchainjs/examples/src/experimental/prompts/handlebars.ts/0 | {
"file_path": "langchainjs/examples/src/experimental/prompts/handlebars.ts",
"repo_id": "langchainjs",
"token_count": 231
} | 836 |
# 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/models/distilbert/test_modeling_flax_distilbert.py/0 | {
"file_path": "transformers/tests/models/distilbert/test_modeling_flax_distilbert.py",
"repo_id": "transformers",
"token_count": 2492
} | 718 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,359 |
# coding=utf-8
# Copyright 2019 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | transformers/src/transformers/models/xlm/tokenization_xlm.py/0 | {
"file_path": "transformers/src/transformers/models/xlm/tokenization_xlm.py",
"repo_id": "transformers",
"token_count": 18360
} | 755 |
"""**Callback handlers** allow listening to events in LangChain.
**Class hierarchy:**
.. code-block::
BaseCallbackHandler --> <name>CallbackHandler # Example: AimCallbackHandler
"""
import warnings
from typing import Any
from langchain_core._api import LangChainDeprecationWarning
from langchain_core.callbacks ... | langchain/libs/langchain/langchain/callbacks/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/__init__.py",
"repo_id": "langchain",
"token_count": 869
} | 447 |
python_tests()
| llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,214 |
<!--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/tasks/zero_shot_object_detection.md/0 | {
"file_path": "transformers/docs/source/ja/tasks/zero_shot_object_detection.md",
"repo_id": "transformers",
"token_count": 5595
} | 554 |
# Copyright 2020-present, the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | transformers/examples/research_projects/movement-pruning/counts_parameters.py/0 | {
"file_path": "transformers/examples/research_projects/movement-pruning/counts_parameters.py",
"repo_id": "transformers",
"token_count": 1428
} | 581 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/datanode/util.go/0 | {
"file_path": "milvus/internal/datanode/util.go",
"repo_id": "milvus",
"token_count": 557
} | 1,793 |
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms";
/**
* Interface for the input parameters specific to the Cohere model.
* @deprecated Use `CohereInput` from `@langchain/cohere` instead.
*/
export interface CohereInput... | langchainjs/libs/langchain-community/src/llms/cohere.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/llms/cohere.ts",
"repo_id": "langchainjs",
"token_count": 1151
} | 971 |
import { OpenAI } from "@langchain/openai";
import { loadQAStuffChain } from "langchain/chains";
import { Document } from "@langchain/core/documents";
// This first example uses the `StuffDocumentsChain`.
const llmA = new OpenAI({});
const chainA = loadQAStuffChain(llmA);
const docs = [
new Document({ pageContent: "... | langchainjs/examples/src/chains/question_answering_stuff.ts/0 | {
"file_path": "langchainjs/examples/src/chains/question_answering_stuff.ts",
"repo_id": "langchainjs",
"token_count": 186
} | 822 |
apiVersion: milvus.io/v1alpha1
kind: MilvusCluster
metadata:
name: my-release
labels:
app: milvus
spec:
components:
image: milvusdb/milvus:master-latest
config:
knowhere:
simdType: avx2
dependencies:
etcd:
inCluster:
deletionPolicy: Delete
pvcDeletion: true
... | milvus/tests/python_client/customize/template/minimum.yaml/0 | {
"file_path": "milvus/tests/python_client/customize/template/minimum.yaml",
"repo_id": "milvus",
"token_count": 597
} | 2,178 |
<jupyter_start><jupyter_text>Astra DB>[DataStax Astra DB](https://docs.datastax.com/en/astra/home/astra.html) is a serverless vector-capable database built on Apache Cassandra and accessed through an easy-to-use JSON API.To run this notebook you need a DataStax Astra DB instance running in the cloud (you can get one fo... | llama_index/docs/examples/vector_stores/AstraDBIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/AstraDBIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 997
} | 1,213 |
/* eslint-disable prettier/prettier */
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
... | tokenizers/bindings/node/jest.config.js/0 | {
"file_path": "tokenizers/bindings/node/jest.config.js",
"repo_id": "tokenizers",
"token_count": 1715
} | 405 |
MILVUS_SERVICE_IP=127.0.0.1
MILVUS_SERVICE_PORT=19530
MILVUS_PYTEST_WORKSPACE=/milvus/tests/python_client
MILVUS_PYTEST_LOG_PATH=/milvus/_artifacts/tests/pytest_logs
IMAGE_REPO=milvusdb
IMAGE_TAG=20240118-c91254f
LATEST_IMAGE_TAG=20240118-c91254f
| milvus/tests/docker/.env/0 | {
"file_path": "milvus/tests/docker/.env",
"repo_id": "milvus",
"token_count": 130
} | 2,012 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/datacoord/index_service.go/0 | {
"file_path": "milvus/internal/datacoord/index_service.go",
"repo_id": "milvus",
"token_count": 10863
} | 1,793 |
from llama_index.packs.evaluator_benchmarker.base import EvaluatorBenchmarkerPack
__all__ = ["EvaluatorBenchmarkerPack"]
| llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/llama_index/packs/evaluator_benchmarker/__init__.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/llama_index/packs/evaluator_benchmarker/__init__.py",
"repo_id": "llama_index",
"token_count": 42
} | 1,700 |
# 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_fast.py/0 | {
"file_path": "transformers/src/transformers/models/mpnet/tokenization_mpnet_fast.py",
"repo_id": "transformers",
"token_count": 3935
} | 637 |
from llama_index.readers.macrometa_gdn.base import MacrometaGDNReader
__all__ = ["MacrometaGDNReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/llama_index/readers/macrometa_gdn/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/llama_index/readers/macrometa_gdn/__init__.py",
"repo_id": "llama_index",
"token_count": 39
} | 1,341 |
"""Shallow tests that make sure we can at least import the code."""
import os
from pytest import MonkeyPatch
def test_redis_url_set() -> None:
"""Verify that the redis URL is set."""
if "REDIS_URL" not in os.environ:
raise AssertionError(
"REDIS_URL not set in environment. "
... | opengpts/backend/tests/unit_tests/test_imports.py/0 | {
"file_path": "opengpts/backend/tests/unit_tests/test_imports.py",
"repo_id": "opengpts",
"token_count": 470
} | 2,057 |
<!--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... | peft/docs/source/developer_guides/troubleshooting.md/0 | {
"file_path": "peft/docs/source/developer_guides/troubleshooting.md",
"repo_id": "peft",
"token_count": 1890
} | 306 |
import { ChatOpenAI } from "@langchain/openai";
import {
HttpResponseOutputParser,
JsonOutputFunctionsParser,
} from "langchain/output_parsers";
const handler = async () => {
const parser = new HttpResponseOutputParser({
contentType: "text/event-stream",
outputParser: new JsonOutputFunctionsParser({ diff... | langchainjs/examples/src/prompts/http_response_output_parser_custom.ts/0 | {
"file_path": "langchainjs/examples/src/prompts/http_response_output_parser_custom.ts",
"repo_id": "langchainjs",
"token_count": 503
} | 847 |
"""**Graphs** provide a natural language interface to graph databases."""
from langchain_community.graphs.arangodb_graph import ArangoGraph
from langchain_community.graphs.falkordb_graph import FalkorDBGraph
from langchain_community.graphs.hugegraph import HugeGraph
from langchain_community.graphs.kuzu_graph import Ku... | langchain/libs/community/langchain_community/graphs/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/graphs/__init__.py",
"repo_id": "langchain",
"token_count": 412
} | 274 |
"""Integration test for LLMChainExtractor."""
from langchain_community.chat_models import ChatOpenAI
from langchain_core.documents import Document
from langchain.retrievers.document_compressors import LLMChainExtractor
def test_llm_construction_with_kwargs() -> None:
llm_chain_kwargs = {"verbose": True}
comp... | langchain/libs/langchain/tests/integration_tests/retrievers/document_compressors/test_chain_extract.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/retrievers/document_compressors/test_chain_extract.py",
"repo_id": "langchain",
"token_count": 620
} | 596 |
# 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/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/__init__.py",
"repo_id": "transformers",
"token_count": 2129
} | 615 |
<jupyter_start><jupyter_text>MistralAIMistral AI is a platform that offers hosting for their powerful open source models.You can access them via their [API](https://docs.mistral.ai/api/).A valid [API key](https://console.mistral.ai/users/api-keys/) is needed to communicate with the API.You will also need the `langchai... | langchain/docs/docs/integrations/providers/mistralai.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/providers/mistralai.ipynb",
"repo_id": "langchain",
"token_count": 159
} | 138 |
<!--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/gpt-sw3.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/gpt-sw3.md",
"repo_id": "transformers",
"token_count": 879
} | 444 |
# 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/xlnet/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/xlnet/__init__.py",
"repo_id": "transformers",
"token_count": 1788
} | 757 |
from collections import deque
from typing import TYPE_CHECKING, Dict, List, Union
if TYPE_CHECKING:
import pandas as pd
class MetricsTrackerAverage:
def __init__(self, step: int):
self.history: List[Dict[str, Union[int, float]]] = [{"step": 0, "score": 0}]
self.step: int = step
self.i... | langchain/libs/experimental/langchain_experimental/rl_chain/metrics.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/rl_chain/metrics.py",
"repo_id": "langchain",
"token_count": 861
} | 422 |
"""Default query for SQLStructStoreIndex."""
import logging
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union, cast
from sqlalchemy import Table
from llama_index.legacy.core.base_query_engine import BaseQueryEngine
from llama_index.legacy.core.response.schema import Response
f... | llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/sql_query.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/sql_query.py",
"repo_id": "llama_index",
"token_count": 8367
} | 1,566 |
---
sidebar_position: 2
---
# Retrieval
Retrieval is a common technique chatbots use to augment their responses with data outside a chat model’s training data. This section will cover how to implement retrieval in the context of chatbots, but it’s worth noting that retrieval is a very subtle and deep topic - we encou... | langchainjs/docs/core_docs/docs/use_cases/chatbots/retrieval.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/use_cases/chatbots/retrieval.mdx",
"repo_id": "langchainjs",
"token_count": 8269
} | 742 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.