text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from langchain_experimental.agents.agent_toolkits.csv.base import create_csv_agent
from langchain_experimental.agents.agent_toolkits.pandas.base import (
create_pandas_dataframe_agent,
)
from langchain_experimental.agents.agent_toolkits.python.base import create_python_agent
from langchain_experimental.agents.agent... | langchain/libs/experimental/langchain_experimental/agents/agent_toolkits/__init__.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/agents/agent_toolkits/__init__.py",
"repo_id": "langchain",
"token_count": 240
} | 412 |
from langchain_community.llms.pipelineai import PipelineAI
__all__ = ["PipelineAI"]
| langchain/libs/langchain/langchain/llms/pipelineai.py/0 | {
"file_path": "langchain/libs/langchain/langchain/llms/pipelineai.py",
"repo_id": "langchain",
"token_count": 29
} | 541 |
package versions
import "github.com/blang/semver/v4"
const (
version210Str = "2.1.0"
version220Str = "2.2.0"
version230Str = "2.3.0"
VersionMaxStr = "1000.1000.1000"
)
var (
Version220 semver.Version
Version210 semver.Version
Version230 semver.Version
VersionMax semver.Version
)
func init() {
Version210, _... | milvus/cmd/tools/migration/versions/version.go/0 | {
"file_path": "milvus/cmd/tools/migration/versions/version.go",
"repo_id": "milvus",
"token_count": 264
} | 1,714 |
use serde::Deserialize;
/// The configuration for the custom resource memberlist provider.
/// # Fields
/// - storage_path: The path to use for temporary storage in the segment manager, if needed.
#[derive(Deserialize)]
pub(crate) struct SegmentManagerConfig {
pub(crate) storage_path: String,
}
| chroma/rust/worker/src/segment/config.rs/0 | {
"file_path": "chroma/rust/worker/src/segment/config.rs",
"repo_id": "chroma",
"token_count": 87
} | 58 |
"""Tools for interacting with a SQL database."""
| langchain/libs/langchain/langchain/tools/sql_database/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/sql_database/__init__.py",
"repo_id": "langchain",
"token_count": 11
} | 569 |
"""Test the FileCopy tool."""
from pathlib import Path
from tempfile import TemporaryDirectory
from langchain_community.tools.file_management.copy import CopyFileTool
from langchain_community.tools.file_management.utils import (
INVALID_PATH_TEMPLATE,
)
def test_copy_file_with_root_dir() -> None:
"""Test th... | langchain/libs/community/tests/unit_tests/tools/file_management/test_copy.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/tools/file_management/test_copy.py",
"repo_id": "langchain",
"token_count": 824
} | 381 |
#!/usr/bin/env bash
python run_asr.py \
--output_dir="./wav2vec2-base-timit-asr" \
--num_train_epochs="30" \
--per_device_train_batch_size="20" \
--per_device_eval_batch_size="20" \
--evaluation_strategy="steps" \
--save_steps="500" \
--eval_steps="100" \
--logging_steps="50" \
--learning_rate="5e-4" \
--warmup_steps="... | transformers/examples/research_projects/wav2vec2/finetune_base_timit_asr.sh/0 | {
"file_path": "transformers/examples/research_projects/wav2vec2/finetune_base_timit_asr.sh",
"repo_id": "transformers",
"token_count": 257
} | 606 |
<!---
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/examples/tensorflow/image-classification/README.md/0 | {
"file_path": "transformers/examples/tensorflow/image-classification/README.md",
"repo_id": "transformers",
"token_count": 2317
} | 582 |
from llama_index.finetuning.callbacks.finetuning_handler import (
BaseFinetuningHandler,
OpenAIFineTuningHandler,
)
__all__ = ["BaseFinetuningHandler", "OpenAIFineTuningHandler"]
| llama_index/llama-index-finetuning/llama_index/finetuning/callbacks/__init__.py/0 | {
"file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/callbacks/__init__.py",
"repo_id": "llama_index",
"token_count": 67
} | 1,237 |
[
{
"server": "athena",
"suite_params": [
{
"suite": "locust_mix.yaml",
"image_type": "gpu"
}
]
}
] | milvus/tests/benchmark/milvus_benchmark/scheduler/locust_mix.json/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/locust_mix.json",
"repo_id": "milvus",
"token_count": 132
} | 1,931 |
python_sources()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tencentvectordb/llama_index/vector_stores/tencentvectordb/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tencentvectordb/llama_index/vector_stores/tencentvectordb/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,680 |
// 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_regex_query_util.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_regex_query_util.cpp",
"repo_id": "milvus",
"token_count": 585
} | 1,768 |
from typing import Dict, Tuple
from langchain.chains.query_constructor.ir import (
Comparator,
Comparison,
Operation,
Operator,
StructuredQuery,
)
from langchain.retrievers.self_query.supabase import SupabaseVectorTranslator
DEFAULT_TRANSLATOR = SupabaseVectorTranslator()
def test_visit_comparis... | langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_supabase.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_supabase.py",
"repo_id": "langchain",
"token_count": 1132
} | 631 |
from argparse import ArgumentParser
from json import dump
from logging import basicConfig, getLogger
from os import linesep, remove
from os.path import exists
from tempfile import NamedTemporaryFile
from typing import Dict, List, Tuple
from requests import get
from sentencepiece import SentencePieceProcessor
from tqdm... | tokenizers/bindings/python/scripts/sentencepiece_extractor.py/0 | {
"file_path": "tokenizers/bindings/python/scripts/sentencepiece_extractor.py",
"repo_id": "tokenizers",
"token_count": 2267
} | 460 |
from typing import TYPE_CHECKING
from ....utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {
"mel": ["Mel"],
"pipeline_audio_diffusion": ["AudioDiffusionPipeline"],
}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .mel import Mel
from .pipeline_audio_diffusion import AudioDiffusi... | diffusers/src/diffusers/pipelines/deprecated/audio_diffusion/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/audio_diffusion/__init__.py",
"repo_id": "diffusers",
"token_count": 212
} | 232 |
"""Lightweight wrapper around requests library, with async support."""
from contextlib import asynccontextmanager
from typing import Any, AsyncGenerator, Dict, Literal, Optional, Union
import aiohttp
import requests
from langchain_core.pydantic_v1 import BaseModel, Extra
from requests import Response
class Requests(... | langchain/libs/community/langchain_community/utilities/requests.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/requests.py",
"repo_id": "langchain",
"token_count": 3517
} | 302 |
import { test, expect } from "@jest/globals";
import { HuggingFaceInferenceEmbeddings } from "../hf.js";
import { HNSWLib } from "../../vectorstores/hnswlib.js";
test("HuggingFaceInferenceEmbeddings", async () => {
const embeddings = new HuggingFaceInferenceEmbeddings();
const texts = [
"Hello world!",
"H... | langchainjs/libs/langchain-community/src/embeddings/tests/hf.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/embeddings/tests/hf.int.test.ts",
"repo_id": "langchainjs",
"token_count": 372
} | 1,022 |
#!/usr/bin/env python
# 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/L... | transformers/src/transformers/tools/text_question_answering.py/0 | {
"file_path": "transformers/src/transformers/tools/text_question_answering.py",
"repo_id": "transformers",
"token_count": 665
} | 687 |
---
sidebar_class_name: hidden
hide_table_of_contents: true
---
import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/guides/expression_language/runnable_history.ts";
import ExampleConstructorConfig from "@examples/guides/expression_language/runnable_history_constructor_config.ts";
# Add message hi... | langchainjs/docs/core_docs/docs/expression_language/how_to/with_history.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/expression_language/how_to/with_history.mdx",
"repo_id": "langchainjs",
"token_count": 485
} | 769 |
<jupyter_start><jupyter_text>Epsilla Vector StoreIn this notebook we are going to show how to use [Epsilla](https://www.epsilla.com/) to perform vector searches in LlamaIndex. As a prerequisite, you need to have a running Epsilla vector database (for example, through our docker image), and install the ``pyepsilla`` pac... | llama_index/docs/examples/vector_stores/EpsillaIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/EpsillaIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1687
} | 1,215 |
<jupyter_start><jupyter_text>__ModuleName____ModuleName__ is a platform that offers...<jupyter_code>from __module_name__ import Chat__ModuleName__
from __module_name__ import __ModuleName__LLM
from __module_name__ import __ModuleName__VectorStore<jupyter_output><empty_output> | langchain/libs/cli/langchain_cli/integration_template/docs/provider.ipynb/0 | {
"file_path": "langchain/libs/cli/langchain_cli/integration_template/docs/provider.ipynb",
"repo_id": "langchain",
"token_count": 88
} | 216 |
version: '3.9'
networks:
test_net:
driver: bridge
services:
test_server:
build:
context: .
dockerfile: Dockerfile
volumes:
- chroma-data:/chroma/chroma
command: "--workers 1 --host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --timeout-keep-alive 30"
... | chroma/docker-compose.test.yml/0 | {
"file_path": "chroma/docker-compose.test.yml",
"repo_id": "chroma",
"token_count": 245
} | 37 |
// 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/drop_collection_task_test.go/0 | {
"file_path": "milvus/internal/rootcoord/drop_collection_task_test.go",
"repo_id": "milvus",
"token_count": 3165
} | 1,918 |
import json
import pickle
import pytest
from tokenizers.pre_tokenizers import (
BertPreTokenizer,
ByteLevel,
CharDelimiterSplit,
Digits,
Metaspace,
PreTokenizer,
Punctuation,
Sequence,
Split,
UnicodeScripts,
Whitespace,
WhitespaceSplit,
)
class TestByteLevel:
def ... | tokenizers/bindings/python/tests/bindings/test_pre_tokenizers.py/0 | {
"file_path": "tokenizers/bindings/python/tests/bindings/test_pre_tokenizers.py",
"repo_id": "tokenizers",
"token_count": 4218
} | 447 |
# SearchApi
This page covers how to use the [SearchApi](https://www.searchapi.io/) Google Search API within LangChain. SearchApi is a real-time SERP API for easy SERP scraping.
## Setup
- Go to [https://www.searchapi.io/](https://www.searchapi.io/) to sign up for a free account
- Get the api key and set it as an env... | langchain/docs/docs/integrations/providers/searchapi.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/searchapi.mdx",
"repo_id": "langchain",
"token_count": 678
} | 159 |
{
"extends": "next/core-web-vitals"
}
| langsmith-cookbook/feedback-examples/nextjs/.eslintrc.json/0 | {
"file_path": "langsmith-cookbook/feedback-examples/nextjs/.eslintrc.json",
"repo_id": "langsmith-cookbook",
"token_count": 20
} | 1,018 |
# EfficientNet (Knapsack Pruned)
**EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method uniformly... | pytorch-image-models/docs/models/efficientnet-pruned.md/0 | {
"file_path": "pytorch-image-models/docs/models/efficientnet-pruned.md",
"repo_id": "pytorch-image-models",
"token_count": 2760
} | 364 |
from llama_index.core.llama_pack import BaseLlamaPack
from llama_index.packs.retry_engine_weaviate import WeaviateRetryEnginePack
def test_class():
names_of_base_classes = [b.__name__ for b in WeaviateRetryEnginePack.__mro__]
assert BaseLlamaPack.__name__ in names_of_base_classes
| llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/tests/test_packs_retry_engine_weaviate.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/tests/test_packs_retry_engine_weaviate.py",
"repo_id": "llama_index",
"token_count": 107
} | 1,816 |
from typing import List, Optional
from llama_index.core.data_structs.data_structs import IndexStruct
from llama_index.core.storage.index_store.types import BaseIndexStore
from llama_index.core.storage.index_store.utils import (
index_struct_to_json,
json_to_index_struct,
)
from llama_index.core.storage.kvstore... | llama_index/llama-index-core/llama_index/core/storage/index_store/keyval_index_store.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/storage/index_store/keyval_index_store.py",
"repo_id": "llama_index",
"token_count": 956
} | 1,220 |
<!--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/low_level_api.md/0 | {
"file_path": "peft/docs/source/developer_guides/low_level_api.md",
"repo_id": "peft",
"token_count": 1262
} | 324 |
package utils
import (
"time"
"google.golang.org/grpc"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/paramtable"
)
func GracefulStopGRPCServer(s *grpc.Server) {
if s == nil {
return
}
ch := make(chan struct{})
go func() {
defer close(ch)
log.Debug("try to graceful stop gr... | milvus/internal/distributed/utils/util.go/0 | {
"file_path": "milvus/internal/distributed/utils/util.go",
"repo_id": "milvus",
"token_count": 273
} | 1,718 |
# 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/chinese_clip/test_processor_chinese_clip.py/0 | {
"file_path": "transformers/tests/models/chinese_clip/test_processor_chinese_clip.py",
"repo_id": "transformers",
"token_count": 3436
} | 805 |
<jupyter_start><jupyter_text>---sidebar_position: 3title: Querying a SQL DB---<jupyter_code>We can replicate our SQLDatabaseChain with Runnables.<jupyter_output><empty_output><jupyter_text>%pip install --upgrade --quiet langchain langchain-openai<jupyter_code>from langchain_core.prompts import ChatPromptTemplate
temp... | langchain/docs/docs/expression_language/cookbook/sql_db.ipynb/0 | {
"file_path": "langchain/docs/docs/expression_language/cookbook/sql_db.ipynb",
"repo_id": "langchain",
"token_count": 629
} | 87 |
from llama_index.callbacks.promptlayer.base import PromptLayerHandler
from llama_index.core.callbacks.base_handler import BaseCallbackHandler
def test_handler_callable():
names_of_base_classes = [b.__name__ for b in PromptLayerHandler.__mro__]
assert BaseCallbackHandler.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/tests/test_promptlayer_callback.py/0 | {
"file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-promptlayer/tests/test_promptlayer_callback.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,185 |
# coding=utf-8
# Copyright 2023 Meta Platforms, Inc. and affiliates, and the HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | transformers/src/transformers/models/encodec/configuration_encodec.py/0 | {
"file_path": "transformers/src/transformers/models/encodec/configuration_encodec.py",
"repo_id": "transformers",
"token_count": 3418
} | 600 |
// 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/util/typeutil/set.go/0 | {
"file_path": "milvus/pkg/util/typeutil/set.go",
"repo_id": "milvus",
"token_count": 1412
} | 1,927 |
// 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/pulsar/pulsar_client.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/pulsar/pulsar_client.go",
"repo_id": "milvus",
"token_count": 2362
} | 1,901 |
import io
from typing import Any, Dict
import pytest
from langchain_core.documents import Document
from pytest import raises
from pytest_mock import MockerFixture
from langchain_community.document_loaders.json_loader import JSONLoader
pytestmark = pytest.mark.requires("jq")
def test_load_valid_string_content(mocke... | langchain/libs/community/tests/unit_tests/document_loaders/test_json_loader.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_json_loader.py",
"repo_id": "langchain",
"token_count": 4251
} | 393 |
# 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/tests/utils/test_hub_utils.py/0 | {
"file_path": "transformers/tests/utils/test_hub_utils.py",
"repo_id": "transformers",
"token_count": 2572
} | 865 |
// @ts-nocheck
// Inlined to deal with portability issues with importing crypto module
/*
* [js-sha1]{@link https://github.com/emn178/js-sha1}
*
* @version 0.6.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
/*jslint bitwise: true */
"use strict";
var root... | langchainjs/langchain-core/src/utils/js-sha1/hash.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/js-sha1/hash.ts",
"repo_id": "langchainjs",
"token_count": 5647
} | 937 |
# This script exports pre-trained model weights in the safetensors format.
import numpy as np
import torch
import torchvision
from safetensors import torch as stt
m = torchvision.models.resnet50(pretrained=True)
stt.save_file(m.state_dict(), 'resnet50.safetensors')
m = torchvision.models.resnet101(pretrained=True)
stt... | candle/candle-examples/examples/resnet/export_models.py/0 | {
"file_path": "candle/candle-examples/examples/resnet/export_models.py",
"repo_id": "candle",
"token_count": 166
} | 55 |
#!/bin/bash
# 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... | milvus/build/kind_provisioner.sh/0 | {
"file_path": "milvus/build/kind_provisioner.sh",
"repo_id": "milvus",
"token_count": 7038
} | 1,624 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/util/indexcgowrapper/build_index_info.go/0 | {
"file_path": "milvus/internal/util/indexcgowrapper/build_index_info.go",
"repo_id": "milvus",
"token_count": 2800
} | 1,903 |
import { useState } from "react";
import dayjs from "dayjs";
import ChevronRight from "../assets/ChevronRight.svg?react";
import { RunState } from "../useStreamLog";
import { cn } from "../utils/cn";
import { str } from "../utils/str";
import { CorrectnessFeedback } from "./feedback/CorrectnessFeedback";
export functi... | langserve/langserve/playground/src/components/IntermediateSteps.tsx/0 | {
"file_path": "langserve/langserve/playground/src/components/IntermediateSteps.tsx",
"repo_id": "langserve",
"token_count": 1183
} | 1,045 |
// 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/mq/msgstream/mqwrapper/rmq/rmq_consumer.go/0 | {
"file_path": "milvus/internal/mq/msgstream/mqwrapper/rmq/rmq_consumer.go",
"repo_id": "milvus",
"token_count": 1123
} | 2,005 |
# Modèle de diffusion conditionné par la classe
<CourseFloatingBanner unit={2}
classNames="absolute z-10 right-0 top-0"
notebooks={[
{label: "Modèle de diffusion conditionné par la classe", value: "https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/units/fr/unit3/class_condition... | diffusion-models-class/units/fr/unit2/3.mdx/0 | {
"file_path": "diffusion-models-class/units/fr/unit2/3.mdx",
"repo_id": "diffusion-models-class",
"token_count": 4505
} | 286 |
from langchain.schema.runnable.config import __all__
EXPECTED_ALL = [
"EmptyDict",
"RunnableConfig",
"acall_func_with_variable_args",
"call_func_with_variable_args",
"ensure_config",
"get_async_callback_manager_for_config",
"get_callback_manager_for_config",
"get_config_list",
"get_... | langchain/libs/langchain/tests/unit_tests/schema/runnable/test_config.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/schema/runnable/test_config.py",
"repo_id": "langchain",
"token_count": 199
} | 609 |
// 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/step_executor.go/0 | {
"file_path": "milvus/internal/rootcoord/step_executor.go",
"repo_id": "milvus",
"token_count": 2325
} | 1,885 |
from langchain_community.tools.openapi.utils.api_models import (
INVALID_LOCATION_TEMPL,
PRIMITIVE_TYPES,
SCHEMA_TYPE,
SUPPORTED_LOCATIONS,
APIOperation,
APIProperty,
APIPropertyBase,
APIPropertyLocation,
APIRequestBody,
APIRequestBodyProperty,
)
__all__ = [
"PRIMITIVE_TYPES... | langchain/libs/langchain/langchain/tools/openapi/utils/api_models.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/openapi/utils/api_models.py",
"repo_id": "langchain",
"token_count": 232
} | 585 |
"""LLM Compiler.
A lot of this code was adapted from the source code of the LLM Compiler repo:
https://github.com/SqueezeAILab/LLMCompiler
"""
import asyncio
import uuid
from typing import (
Any,
Dict,
List,
Optional,
Sequence,
cast,
)
from llama_index.core.agent.types import (
BaseAgent... | llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/step.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/step.py",
"repo_id": "llama_index",
"token_count": 6846
} | 1,829 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/util/importutilv2/numpy/field_reader.go/0 | {
"file_path": "milvus/internal/util/importutilv2/numpy/field_reader.go",
"repo_id": "milvus",
"token_count": 3320
} | 2,076 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | transformers/examples/flax/language-modeling/run_bart_dlm_flax.py/0 | {
"file_path": "transformers/examples/flax/language-modeling/run_bart_dlm_flax.py",
"repo_id": "transformers",
"token_count": 18354
} | 518 |
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
/**
* @param {string} relativePath
* @returns {string}
*/
function abs(relativePath) {
return resolve(dirname(fileURLToPath(import.meta.url)), relativePath);
}
export const config = {
internals: [/node\:/, /js-tiktoken/],
... | langchainjs/langchain-core/langchain.config.js/0 | {
"file_path": "langchainjs/langchain-core/langchain.config.js",
"repo_id": "langchainjs",
"token_count": 902
} | 893 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/tests/test_hooks.py/0 | {
"file_path": "accelerate/tests/test_hooks.py",
"repo_id": "accelerate",
"token_count": 6551
} | 21 |
---
sidebar_position: 3
---
# Query validation
Perhaps the most error-prone part of any SQL chain or agent is writing valid and safe SQL queries.
In this guide we'll go over some strategies for validating our queries and handling invalid queries.
## Setup
First, get required packages and set environment variables:
... | langchainjs/docs/core_docs/docs/use_cases/sql/query_checking.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/use_cases/sql/query_checking.mdx",
"repo_id": "langchainjs",
"token_count": 534
} | 800 |
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
plugins: ["@typescript-eslint"],
ignorePatterns: ["*.cjs"],
overrides: [
{
files: ["*.svelte"],
parser: "svelte... | chat-ui/.eslintrc.cjs/0 | {
"file_path": "chat-ui/.eslintrc.cjs",
"repo_id": "chat-ui",
"token_count": 419
} | 88 |
from abc import abstractmethod
from typing import Optional, Sequence, Tuple
from uuid import UUID
from chromadb.types import (
Collection,
Database,
Tenant,
Metadata,
Segment,
SegmentScope,
OptionalArgument,
Unspecified,
UpdateMetadata,
)
from chromadb.config import DEFAULT_DATABASE,... | chroma/chromadb/db/system.py/0 | {
"file_path": "chroma/chromadb/db/system.py",
"repo_id": "chroma",
"token_count": 1807
} | 15 |
""" JIT scripting/tracing utils
Hacked together by / Copyright 2020 Ross Wightman
"""
import os
import torch
def set_jit_legacy():
""" Set JIT executor to legacy w/ support for op fusion
This is hopefully a temporary need in 1.5/1.5.1/1.6 to restore performance due to changes
in the JIT exectutor. These... | pytorch-image-models/timm/utils/jit.py/0 | {
"file_path": "pytorch-image-models/timm/utils/jit.py",
"repo_id": "pytorch-image-models",
"token_count": 1036
} | 375 |
import os
import shutil
from collections import defaultdict
from datetime import datetime
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Tuple,
TypedDict,
Union,
)
from llama_index.legacy.callbacks.base_handler import BaseCallbackHandler
from ... | llama_index/llama-index-legacy/llama_index/legacy/callbacks/wandb_callback.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/wandb_callback.py",
"repo_id": "llama_index",
"token_count": 9473
} | 1,552 |
import os
from typing import Dict, List
import pytest
from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode
from llama_index.legacy.vector_stores import ChromaVectorStore
from llama_index.legacy.vector_stores.types import VectorStoreQuery
##
# Start chromadb locally
# cd tests
# docker-com... | llama_index/llama-index-legacy/tests/vector_stores/test_chromadb.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_chromadb.py",
"repo_id": "llama_index",
"token_count": 2478
} | 1,635 |
import subprocess
import json
def get_chart_version(repo = "milvus/milvus", app_version="2.2.0"):
"""
Get helm chart version by app version
"""
if app_version.startswith("v"):
app_version = app_version[1:]
cmd = f"helm search repo {repo} -l -o json"
result = subprocess.check_output(cmd, ... | milvus/tests/scripts/get_helm_chart_version_by_app_version.py/0 | {
"file_path": "milvus/tests/scripts/get_helm_chart_version_by_app_version.py",
"repo_id": "milvus",
"token_count": 466
} | 2,131 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.faiss import FaissReader
def test_class():
names_of_base_classes = [b.__name__ for b in FaissReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-faiss/tests/test_readers_faiss.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-faiss/tests/test_readers_faiss.py",
"repo_id": "llama_index",
"token_count": 88
} | 1,431 |
<jupyter_start><jupyter_text>Select by maximal marginal relevance (MMR)The `MaxMarginalRelevanceExampleSelector` selects examples based on a combination of which examples are most similar to the inputs, while also optimizing for diversity. It does this by finding the examples with the embeddings that have the greatest ... | langchain/docs/docs/modules/model_io/prompts/example_selector_types/mmr.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/model_io/prompts/example_selector_types/mmr.ipynb",
"repo_id": "langchain",
"token_count": 949
} | 208 |
import { z } from "zod";
import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";
import { ChatOpenAI } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
const zodSchema = z.object({
movie_title: z.string(),
critic: z.string(),
tone: z.enum(["p... | langchainjs/examples/src/document_transformers/metadata_tagger.ts/0 | {
"file_path": "langchainjs/examples/src/document_transformers/metadata_tagger.ts",
"repo_id": "langchainjs",
"token_count": 658
} | 832 |
# Copyright 2024 ParaDiGMS authors and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | diffusers/tests/schedulers/test_scheduler_ddim_parallel.py/0 | {
"file_path": "diffusers/tests/schedulers/test_scheduler_ddim_parallel.py",
"repo_id": "diffusers",
"token_count": 3801
} | 291 |
:mod:`{{module}}`.{{objname}}
{{ underline }}==============
.. currentmodule:: {{ module }}
.. autopydantic_model:: {{ objname }}
:model-show-json: False
:model-show-config-summary: False
:model-show-validator-members: False
:model-show-field-summary: False
:field-signature-prefix: param
:memb... | langchain/docs/api_reference/templates/pydantic.rst/0 | {
"file_path": "langchain/docs/api_reference/templates/pydantic.rst",
"repo_id": "langchain",
"token_count": 204
} | 79 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/bit/test_modeling_bit.py/0 | {
"file_path": "transformers/tests/models/bit/test_modeling_bit.py",
"repo_id": "transformers",
"token_count": 5077
} | 709 |
// 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/azure_object_storage.go/0 | {
"file_path": "milvus/internal/storage/azure_object_storage.go",
"repo_id": "milvus",
"token_count": 2950
} | 1,925 |
"""
AdamP Optimizer Implementation copied from https://github.com/clovaai/AdamP/blob/master/adamp/adamp.py
Paper: `Slowing Down the Weight Norm Increase in Momentum-based Optimizers` - https://arxiv.org/abs/2006.08217
Code: https://github.com/clovaai/AdamP
Copyright (c) 2020-present NAVER Corp.
MIT license
"""
impor... | pytorch-image-models/timm/optim/adamp.py/0 | {
"file_path": "pytorch-image-models/timm/optim/adamp.py",
"repo_id": "pytorch-image-models",
"token_count": 1863
} | 371 |
from langchain_community.document_loaders.figma import FigmaFileLoader
__all__ = ["FigmaFileLoader"]
| langchain/libs/langchain/langchain/document_loaders/figma.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/figma.py",
"repo_id": "langchain",
"token_count": 31
} | 506 |
---
sidebar_position: 1
---
# Installation
## Supported Environments
LangChain is written in TypeScript and can be used in:
- Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x
- Cloudflare Workers
- Vercel / Next.js (Browser, Serverless and Edge functions)
- Supabase Edge Functions
- Browser
- Deno
- Bun
However, note... | langchainjs/docs/core_docs/docs/get_started/installation.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/get_started/installation.mdx",
"repo_id": "langchainjs",
"token_count": 2191
} | 694 |
from neo4j_cypher_memory.chain import chain
if __name__ == "__main__":
original_query = "Who played in Top Gun?"
print( # noqa: T201
chain.invoke(
{
"question": original_query,
"user_id": "user_123",
"session_id": "session_1",
}
... | langchain/templates/neo4j-cypher-memory/main.py/0 | {
"file_path": "langchain/templates/neo4j-cypher-memory/main.py",
"repo_id": "langchain",
"token_count": 342
} | 642 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,293 |
import { GithubRepoLoader } from "langchain/document_loaders/web/github";
export const run = async () => {
const loader = new GithubRepoLoader(
"https://github.com/langchain-ai/langchainjs",
{ branch: "main", recursive: false, unknown: "warn", ignorePaths: ["*.md"] }
);
const docs = await loader.load();
... | langchainjs/examples/src/document_loaders/github_ignore_paths.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/github_ignore_paths.ts",
"repo_id": "langchainjs",
"token_count": 124
} | 783 |
# Portkey
>[Portkey](https://docs.portkey.ai/overview/introduction) is a platform designed to streamline the deployment
> and management of Generative AI applications.
> It provides comprehensive features for monitoring, managing models,
> and improving the performance of your AI applications.
## LLMOps for Langcha... | langchain/docs/docs/integrations/providers/portkey/index.md/0 | {
"file_path": "langchain/docs/docs/integrations/providers/portkey/index.md",
"repo_id": "langchain",
"token_count": 1773
} | 142 |
from typing import Any, Dict, List
import numpy as np
# required modules
REDIS_REQUIRED_MODULES = [
{"name": "search", "ver": 20600},
{"name": "searchlight", "ver": 20600},
]
# distance metrics
REDIS_DISTANCE_METRICS: List[str] = ["COSINE", "IP", "L2"]
# supported vector datatypes
REDIS_VECTOR_DTYPE_MAP: Di... | langchain/libs/community/langchain_community/vectorstores/redis/constants.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/redis/constants.py",
"repo_id": "langchain",
"token_count": 179
} | 318 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "cache/cloudflare_kv",
newEntrypointName: "",
newPackageName: "@langchain/cloudflare",
});
export * from "@langchain/community/caches/cloudflare_kv";
| langchainjs/langchain/src/cache/cloudflare_kv.ts/0 | {
"file_path": "langchainjs/langchain/src/cache/cloudflare_kv.ts",
"repo_id": "langchainjs",
"token_count": 102
} | 885 |
# LlamaIndex Readers Integration: Genius
This loader connects to the Genius API and loads lyrics, metadata, and album art into `Documents`.
As a prerequisite, you will need to register with [Genius API](https://genius.com/api-clients) and create an app in order to get a `client_id` and a `client_secret`. You should t... | llama_index/llama-index-integrations/readers/llama-index-readers-genius/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-genius/README.md",
"repo_id": "llama_index",
"token_count": 1079
} | 1,446 |
from llama_index.packs.recursive_retriever.embedded_tables_unstructured.base import (
EmbeddedTablesUnstructuredRetrieverPack,
)
from llama_index.packs.recursive_retriever.small_to_big.base import (
RecursiveRetrieverSmallToBigPack,
)
__all__ = [
"EmbeddedTablesUnstructuredRetrieverPack",
"RecursiveRet... | llama_index/llama-index-packs/llama-index-packs-recursive-retriever/llama_index/packs/recursive_retriever/__init__.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-recursive-retriever/llama_index/packs/recursive_retriever/__init__.py",
"repo_id": "llama_index",
"token_count": 129
} | 1,693 |
package dbmodel
import (
"time"
"github.com/chroma/chroma-coordinator/internal/types"
)
type Segment struct {
ID string `gorm:"id;primaryKey"`
Type string `gorm:"type;type:string;not null"`
Scope string `gorm:"scope"`
Topic *string `gorm:"topic... | chroma/go/coordinator/internal/metastore/db/dbmodel/segment.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/segment.go",
"repo_id": "chroma",
"token_count": 573
} | 53 |
python_tests()
| llama_index/llama-index-integrations/tools/llama-index-tools-python-file/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-python-file/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,630 |
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.codespell]
check-filenames = true
check-hidden = true
skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
[tool.llamahub]
classes = ["AwaDBVectorStore"]
contains_example = false
import_path = "llama_index.vector_stores.awad... | llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-awadb/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-awadb/pyproject.toml",
"repo_id": "llama_index",
"token_count": 641
} | 1,470 |
use candle::{IndexOp, Result, Tensor, D};
use candle_nn::{layer_norm, LayerNorm, Linear, Module, VarBuilder};
const IMG_SIZE: usize = 518;
const PATCH_SIZE: usize = 14;
const NUM_CLASSES: usize = 1000;
fn linear(vb: VarBuilder, in_dim: usize, out_dim: usize, bias: bool) -> Result<Linear> {
if bias {
candl... | candle/candle-transformers/src/models/dinov2.rs/0 | {
"file_path": "candle/candle-transformers/src/models/dinov2.rs",
"repo_id": "candle",
"token_count": 4376
} | 71 |
// 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_client.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/nmq/nmq_client.go",
"repo_id": "milvus",
"token_count": 2481
} | 1,816 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/tests/test_memory_utils.py/0 | {
"file_path": "accelerate/tests/test_memory_utils.py",
"repo_id": "accelerate",
"token_count": 1740
} | 18 |
python_sources()
| llama_index/llama-index-core/llama_index/core/command_line/new_package/common/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/command_line/new_package/common/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,203 |
/* eslint-disable no-process-env */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { test } from "@jest/globals";
import { NotionDBLoader } from "../web/notiondb.js";
test.skip("Test NotionDBLoader", async () => {
const loader = new NotionDBLoader({
pageSizeLimit: 10,
notionApiVersion:... | langchainjs/langchain/src/document_loaders/tests/notiondb.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/notiondb.int.test.ts",
"repo_id": "langchainjs",
"token_count": 170
} | 922 |
from __future__ import annotations
import asyncio
import uuid
import warnings
from asyncio import Task
from concurrent.futures import ThreadPoolExecutor
from typing import (
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
Tuple,
Type,
TypeVar,
cast,
)
import numpy as np... | langchain/libs/partners/astradb/langchain_astradb/vectorstores/astradb.py/0 | {
"file_path": "langchain/libs/partners/astradb/langchain_astradb/vectorstores/astradb.py",
"repo_id": "langchain",
"token_count": 23646
} | 661 |
import * as load from "langchain/load";
import * as load_serializable from "langchain/load/serializable";
import * as agents from "langchain/agents";
import * as agents_toolkits from "langchain/agents/toolkits";
import * as agents_toolkits_connery from "langchain/agents/toolkits/connery";
import * as agents_format_scra... | langchainjs/environment_tests/test-exports-esm/src/entrypoints.js/0 | {
"file_path": "langchainjs/environment_tests/test-exports-esm/src/entrypoints.js",
"repo_id": "langchainjs",
"token_count": 2555
} | 833 |
// Copyright (c) 2023, Tri Dao.
// Splitting the different head dimensions to different files to speed up compilation.
// This file is auto-generated. See "generate_kernels.py"
#include "flash_fwd_launch_template.h"
template<>
void run_mha_fwd_<cutlass::half_t, 192>(Flash_fwd_params ¶ms, cudaStream_t stream) {
... | candle/candle-flash-attn/kernels/flash_fwd_hdim192_fp16_sm80.cu/0 | {
"file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim192_fp16_sm80.cu",
"repo_id": "candle",
"token_count": 135
} | 54 |
<script lang="ts">
import { page } from "$app/stores";
import { getHref } from "$lib/utils/getHref";
import PaginationArrow from "./PaginationArrow.svelte";
export let classNames = "";
export let numItemsPerPage: number;
export let numTotalItems: number;
const ELLIPSIS_IDX = -1 as const;
$: numTotalPages = M... | chat-ui/src/lib/components/Pagination.svelte/0 | {
"file_path": "chat-ui/src/lib/components/Pagination.svelte",
"repo_id": "chat-ui",
"token_count": 1210
} | 101 |
from langchain_community.retrievers.cohere_rag_retriever import (
CohereRagRetriever,
)
__all__ = ["CohereRagRetriever"]
| langchain/libs/langchain/langchain/retrievers/cohere_rag_retriever.py/0 | {
"file_path": "langchain/libs/langchain/langchain/retrievers/cohere_rag_retriever.py",
"repo_id": "langchain",
"token_count": 50
} | 579 |
import { Api } from "./generated";
import Count200Response = Api.Count200Response;
import { AdminClient } from "./AdminClient";
// a function to convert a non-Array object to an Array
export function toArray<T>(obj: T | Array<T>): Array<T> {
if (Array.isArray(obj)) {
return obj;
} else {
return [obj];
}
... | chroma/clients/js/src/utils.ts/0 | {
"file_path": "chroma/clients/js/src/utils.ts",
"repo_id": "chroma",
"token_count": 1034
} | 36 |
<!--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/en/model_doc/llava.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/llava.md",
"repo_id": "transformers",
"token_count": 1228
} | 494 |
[tool.poetry]
name = "stepback-qa-prompting"
version = "0.0.1"
description = "Use Step-Back prompting to improve retrieval"
authors = []
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
duckduckgo-search = "^3.9.3"
openai = "<2"
[tool.poetry.group.dev.dependencies]
langchain-... | langchain/templates/stepback-qa-prompting/pyproject.toml/0 | {
"file_path": "langchain/templates/stepback-qa-prompting/pyproject.toml",
"repo_id": "langchain",
"token_count": 263
} | 713 |
// 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/common/Channel.h/0 | {
"file_path": "milvus/internal/core/src/common/Channel.h",
"repo_id": "milvus",
"token_count": 705
} | 1,917 |
import re
from typing import Generator
from bs4 import BeautifulSoup, Doctype, NavigableString, Tag
def langchain_docs_extractor(soup: BeautifulSoup) -> str:
# Remove all the tags that are not meaningful for the extraction.
SCAPE_TAGS = ["nav", "footer", "aside", "script", "style"]
[tag.decompose() for t... | chat-langchain/parser.py/0 | {
"file_path": "chat-langchain/parser.py",
"repo_id": "chat-langchain",
"token_count": 2976
} | 9 |
---
sidebar_label: TS Evaluation
sidebar_position: 5
---
# JavaScript Testing & Evaluation Examples
Incorporate LangSmith into your TS/JS testing and evaluation workflow:
- [Vision-based Evals in JavaScript](./vision-evals/): evaluate AI-generated UIs using GPT-4V
We are working to add more JS examples soon. In the... | langsmith-cookbook/typescript-testing-examples/README.md/0 | {
"file_path": "langsmith-cookbook/typescript-testing-examples/README.md",
"repo_id": "langsmith-cookbook",
"token_count": 157
} | 1,074 |
"""Tool to generate an image."""
from langchain_community.tools.steamship_image_generation.tool import (
SteamshipImageGenerationTool,
)
__all__ = ["SteamshipImageGenerationTool"]
| langchain/libs/langchain/langchain/tools/steamship_image_generation/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/steamship_image_generation/__init__.py",
"repo_id": "langchain",
"token_count": 59
} | 568 |
---
sidebar_position: 3
hide_table_of_contents: true
sidebar_class_name: node-only
sidebar_label: Playwright
---
# Webpages, with Playwright
:::tip Compatibility
Only available on Node.js.
:::
This example goes over how to load data from webpages using Playwright. One document will be created for each webpage.
Play... | langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/web_playwright.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/web_playwright.mdx",
"repo_id": "langchainjs",
"token_count": 955
} | 761 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.