text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
import { test, expect } from "@jest/globals";
import { Calculator } from "../../tools/calculator.js";
test("Calculator tool, sum", async () => {
const calculator = new Calculator();
const result = await calculator.call("1 + 1");
expect(result).toBe("2");
});
test("Calculator tool, product", async () => {
cons... | langchainjs/langchain/src/agents/tests/calculator.test.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/tests/calculator.test.ts",
"repo_id": "langchainjs",
"token_count": 294
} | 881 |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/gptj.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/gptj.md",
"repo_id": "transformers",
"token_count": 2807
} | 484 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/detr/test_modeling_detr.py/0 | {
"file_path": "transformers/tests/models/detr/test_modeling_detr.py",
"repo_id": "transformers",
"token_count": 12985
} | 711 |
<!--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/ko/pad_truncation.md/0 | {
"file_path": "transformers/docs/source/ko/pad_truncation.md",
"repo_id": "transformers",
"token_count": 5964
} | 503 |
package dao
import (
"testing"
"github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel"
"github.com/chroma/chroma-coordinator/internal/types"
"github.com/stretchr/testify/assert"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
func TestSegmentDb_GetSegments(t *testing.T) {
db, err := gorm.Open(sqlite.Ope... | chroma/go/coordinator/internal/metastore/db/dao/segment_test.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dao/segment_test.go",
"repo_id": "chroma",
"token_count": 1167
} | 46 |
# 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 applicabl... | trl/tests/test_sft_trainer.py/0 | {
"file_path": "trl/tests/test_sft_trainer.py",
"repo_id": "trl",
"token_count": 18179
} | 814 |
from langchain_community.tools.playwright.get_elements import (
GetElementsTool,
GetElementsToolInput,
)
__all__ = ["GetElementsToolInput", "GetElementsTool"]
| langchain/libs/langchain/langchain/tools/playwright/get_elements.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/playwright/get_elements.py",
"repo_id": "langchain",
"token_count": 58
} | 563 |
""" Relative position embedding modules and functions
Hacked together by / Copyright 2022 Ross Wightman
"""
import math
import os
from typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from .grid import ndgrid
from .interpolate import RegularGridInterpolator
from .mlp i... | pytorch-image-models/timm/layers/pos_embed_rel.py/0 | {
"file_path": "pytorch-image-models/timm/layers/pos_embed_rel.py",
"repo_id": "pytorch-image-models",
"token_count": 9303
} | 391 |
import importlib
import logging
from typing import Optional, cast, Dict, TypeVar, Any
import requests
from overrides import override
from pydantic import SecretStr
from chromadb.auth import (
ServerAuthCredentialsProvider,
AbstractCredentials,
ClientAuthCredentialsProvider,
AuthInfoType,
ClientAuth... | chroma/chromadb/auth/providers.py/0 | {
"file_path": "chroma/chromadb/auth/providers.py",
"repo_id": "chroma",
"token_count": 3107
} | 12 |
from langchain_community.agent_toolkits.powerbi.base import create_pbi_agent
__all__ = ["create_pbi_agent"]
| langchain/libs/langchain/langchain/agents/agent_toolkits/powerbi/base.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/powerbi/base.py",
"repo_id": "langchain",
"token_count": 38
} | 481 |
<!--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/api/pipelines/pix2pix.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/pix2pix.md",
"repo_id": "diffusers",
"token_count": 707
} | 174 |
import copy
import itertools
import sys
import warnings
from collections import Counter
from copy import deepcopy
from dataclasses import dataclass
from functools import partial
from itertools import cycle, islice
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union
import numpy as ... | datasets/src/datasets/iterable_dataset.py/0 | {
"file_path": "datasets/src/datasets/iterable_dataset.py",
"repo_id": "datasets",
"token_count": 46473
} | 142 |
# coding=utf-8
# Copyright 2024 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | diffusers/scripts/convert_i2vgen_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_i2vgen_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 9967
} | 226 |
package command
import (
"flag"
"fmt"
"os"
"github.com/milvus-io/milvus/cmd/tools/migration/configs"
"github.com/milvus-io/milvus/cmd/tools/migration/console"
)
func Execute(args []string) {
flags := flag.NewFlagSet(args[0], flag.ExitOnError)
flags.Usage = func() {
fmt.Fprintln(os.Stderr, usageLineV2)
}
... | milvus/cmd/tools/migration/command/main.go/0 | {
"file_path": "milvus/cmd/tools/migration/command/main.go",
"repo_id": "milvus",
"token_count": 299
} | 1,723 |
<!--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/ja/model_doc/data2vec.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/data2vec.md",
"repo_id": "transformers",
"token_count": 3072
} | 494 |
import logging
from abc import ABC, abstractmethod
from itertools import islice
from typing import Any, Dict, Iterable, List, Optional
from langchain_community.utilities.redis import get_client
from langchain_core.language_models import BaseLanguageModel
from langchain_core.messages import BaseMessage, get_buffer_stri... | langchain/libs/langchain/langchain/memory/entity.py/0 | {
"file_path": "langchain/libs/langchain/langchain/memory/entity.py",
"repo_id": "langchain",
"token_count": 6824
} | 557 |
from neo4j_cypher_ft.chain import chain
__all__ = ["chain"]
| langchain/templates/neo4j-cypher-ft/neo4j_cypher_ft/__init__.py/0 | {
"file_path": "langchain/templates/neo4j-cypher-ft/neo4j_cypher_ft/__init__.py",
"repo_id": "langchain",
"token_count": 23
} | 641 |
from llama_index.multi_modal_llms.dashscope.base import (
DashScopeMultiModal,
DashScopeMultiModalModels,
)
__all__ = ["DashScopeMultiModal", "DashScopeMultiModalModels"]
| llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/llama_index/multi_modal_llms/dashscope/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/llama_index/multi_modal_llms/dashscope/__init__.py",
"repo_id": "llama_index",
"token_count": 67
} | 1,428 |
import { initializeAgentExecutorWithOptions } from "langchain/agents";
import { OpenAI } from "@langchain/openai";
import { Calculator } from "langchain/tools/calculator";
import { SerpAPI } from "@langchain/community/tools/serpapi";
const model = new OpenAI({ temperature: 0 });
const tools = [
new SerpAPI(process.e... | langchainjs/examples/src/agents/mrkl.ts/0 | {
"file_path": "langchainjs/examples/src/agents/mrkl.ts",
"repo_id": "langchainjs",
"token_count": 262
} | 767 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/vector_stores/google/generativeai/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/google/generativeai/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,610 |
from operator import itemgetter
import numpy as np
from langchain.retrievers import (
ArxivRetriever,
KayAiRetriever,
PubMedRetriever,
WikipediaRetriever,
)
from langchain.schema import StrOutputParser
from langchain.utils.math import cosine_similarity
from langchain_community.chat_models import ChatOp... | langchain/templates/rag-multi-index-fusion/rag_multi_index_fusion/chain.py/0 | {
"file_path": "langchain/templates/rag-multi-index-fusion/rag_multi_index_fusion/chain.py",
"repo_id": "langchain",
"token_count": 1208
} | 677 |
"""Test the loading function for evaluators."""
from typing import List
import pytest
from langchain_community.embeddings.fake import FakeEmbeddings
from langchain.evaluation.loading import EvaluatorType, load_evaluators
from langchain.evaluation.schema import PairwiseStringEvaluator, StringEvaluator
from tests.unit_... | langchain/libs/langchain/tests/unit_tests/evaluation/test_loading.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/test_loading.py",
"repo_id": "langchain",
"token_count": 925
} | 631 |
# Metric Card for COVAL
## Metric description
CoVal is a coreference evaluation tool for the [CoNLL](https://huggingface.co/datasets/conll2003) and [ARRAU](https://catalog.ldc.upenn.edu/LDC2013T22) datasets which implements of the common evaluation metrics including MUC [Vilain et al, 1995](https://aclanthology.org/M... | datasets/metrics/coval/README.md/0 | {
"file_path": "datasets/metrics/coval/README.md",
"repo_id": "datasets",
"token_count": 8053
} | 129 |
import { test, expect } from "@jest/globals";
import * as url from "node:url";
import * as path from "node:path";
import { DocxLoader } from "../fs/docx.js";
test("Test Word doc loader from file", async () => {
const filePath = path.resolve(
path.dirname(url.fileURLToPath(import.meta.url)),
"./example_data/a... | langchainjs/langchain/src/document_loaders/tests/docx.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/docx.test.ts",
"repo_id": "langchainjs",
"token_count": 186
} | 893 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package syncmgr
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// MockSerializer is an autogenerated mock type for the Serializer type
type MockSerializer struct {
mock.Mock
}
type MockSerializer_Expecter struct {
mock *mock.Mock
}
func ... | milvus/internal/datanode/syncmgr/mock_serializer.go/0 | {
"file_path": "milvus/internal/datanode/syncmgr/mock_serializer.go",
"repo_id": "milvus",
"token_count": 963
} | 1,808 |
<jupyter_start><jupyter_text>Multi-modal RAG with Google Cloud This tutorial demonstrates how to implement the Option 2 described [here](https://github.com/langchain-ai/langchain/blob/master/cookbook/Multi_modal_RAG.ipynb) with Generative API on Google Cloud. SetupInstall the required dependencies, and create an API k... | langchain/cookbook/Multi_modal_RAG_google.ipynb/0 | {
"file_path": "langchain/cookbook/Multi_modal_RAG_google.ipynb",
"repo_id": "langchain",
"token_count": 4821
} | 68 |
[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 = ["LlamaDatasetMetadataPack"]
contains_example = false
import_path = "llama_index.packs.llam... | llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/pyproject.toml",
"repo_id": "llama_index",
"token_count": 687
} | 1,676 |
# TypeORM
To enable vector search in a generic PostgreSQL database, LangChain.js supports using [TypeORM](https://typeorm.io/) with the [`pgvector`](https://github.com/pgvector/pgvector) Postgres extension.
## Setup
To work with TypeORM, you need to install the `typeorm` and `pg` packages:
```bash npm2yarn
npm inst... | langchainjs/docs/core_docs/docs/integrations/vectorstores/typeorm.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/typeorm.mdx",
"repo_id": "langchainjs",
"token_count": 450
} | 776 |
python_sources()
| llama_index/llama-index-cli/llama_index/cli/BUILD/0 | {
"file_path": "llama_index/llama-index-cli/llama_index/cli/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,134 |
import { S3Loader } from "langchain/document_loaders/web/s3";
const loader = new S3Loader({
bucket: "my-document-bucket-123",
key: "AccountingOverview.pdf",
s3Config: {
region: "us-east-1",
credentials: {
accessKeyId: "AKIAIOSFODNN7EXAMPLE",
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXA... | langchainjs/examples/src/document_loaders/s3.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/s3.ts",
"repo_id": "langchainjs",
"token_count": 212
} | 785 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/storage/print_binlog_test.go/0 | {
"file_path": "milvus/internal/storage/print_binlog_test.go",
"repo_id": "milvus",
"token_count": 6163
} | 1,789 |
// 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/flowgraph/flow_graph.go/0 | {
"file_path": "milvus/internal/util/flowgraph/flow_graph.go",
"repo_id": "milvus",
"token_count": 1532
} | 1,868 |
{
"extends": "next/core-web-vitals"
}
| weblangchain/nextjs/.eslintrc.json/0 | {
"file_path": "weblangchain/nextjs/.eslintrc.json",
"repo_id": "weblangchain",
"token_count": 20
} | 1,929 |
<jupyter_start><jupyter_text>DataForSEO>[DataForSeo](https://dataforseo.com/) provides comprehensive SEO and digital marketing data solutions via API.>>The `DataForSeo API` retrieves `SERP` from the most popular search engines like `Google`, `Bing`, `Yahoo`. It also allows to >get SERPs from different search engine typ... | langchain/docs/docs/integrations/tools/dataforseo.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/dataforseo.ipynb",
"repo_id": "langchain",
"token_count": 1328
} | 185 |
# coding=utf-8
# Copyright 2022 Facebook AI Research 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 copy of the Licens... | transformers/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py/0 | {
"file_path": "transformers/src/transformers/models/xlm_roberta/modeling_flax_xlm_roberta.py",
"repo_id": "transformers",
"token_count": 26076
} | 773 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import type { ToolInterface } from "@langchain/core/tools";
import { DynamicTool } from "@langchain/core/tools";
import { Toolkit } from "@langchain/community/agents/toolkits/base";
import { JsonSpec } from "../../../tools/json.js";... | langchainjs/langchain/src/agents/toolkits/openapi/openapi.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/toolkits/openapi/openapi.ts",
"repo_id": "langchainjs",
"token_count": 1345
} | 883 |
<jupyter_start><jupyter_text>Where FilteringThis notebook demonstrates how to use where filtering to filter the data returned from get or query.<jupyter_code>import chromadb
client = chromadb.Client()
# Create a new chroma collection
collection_name = "filter_example_collection"
collection = client.create_collection(na... | chroma/examples/basic_functionality/where_filtering.ipynb/0 | {
"file_path": "chroma/examples/basic_functionality/where_filtering.ipynb",
"repo_id": "chroma",
"token_count": 1237
} | 39 |
"""Empty Index."""
from llama_index.legacy.indices.empty.base import EmptyIndex, GPTEmptyIndex
from llama_index.legacy.indices.empty.retrievers import EmptyIndexRetriever
__all__ = ["EmptyIndex", "EmptyIndexRetriever", "GPTEmptyIndex"]
| llama_index/llama-index-legacy/llama_index/legacy/indices/empty/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/empty/__init__.py",
"repo_id": "llama_index",
"token_count": 80
} | 1,714 |
# coding=utf-8
# Copyright 2019 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/test_modeling_common.py/0 | {
"file_path": "transformers/tests/test_modeling_common.py",
"repo_id": "transformers",
"token_count": 94207
} | 756 |
<jupyter_start><jupyter_text>Agent ExecutorThis notebook walks through an example creating an agent executor to work with an existing LangChain agent.This is useful for getting started quickly.However, it is highly likely you will want to customize the logic - for information on that, check out the other examples in th... | langgraph/examples/agent_executor/high-level.ipynb/0 | {
"file_path": "langgraph/examples/agent_executor/high-level.ipynb",
"repo_id": "langgraph",
"token_count": 1219
} | 1,114 |
import { BaseLLMOutputParser } from "@langchain/core/output_parsers";
import type { ChatGeneration } from "@langchain/core/outputs";
export type ParsedToolCall = {
id?: string;
type: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
args: Record<string, any>;
/** @deprecated Use `type... | langchainjs/langchain/src/output_parsers/openai_tools.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/openai_tools.ts",
"repo_id": "langchainjs",
"token_count": 1588
} | 938 |
# coding=utf-8
# Copyright 2021 Mesh TensorFlow authors, T5 Authors and 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... | transformers/src/transformers/models/mt5/modeling_flax_mt5.py/0 | {
"file_path": "transformers/src/transformers/models/mt5/modeling_flax_mt5.py",
"repo_id": "transformers",
"token_count": 1465
} | 704 |
import { SignatureV4 } from "@smithy/signature-v4";
import { HttpRequest } from "@smithy/protocol-http";
import { EventStreamCodec } from "@smithy/eventstream-codec";
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
import { Sha256 } from "@aws-crypto/sha256-js";
import { CallbackManagerForLLMRun } from "@langcha... | langchainjs/libs/langchain-community/src/chat_models/bedrock/web.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/chat_models/bedrock/web.ts",
"repo_id": "langchainjs",
"token_count": 5117
} | 981 |
export const apiBaseUrl =
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
| chat-langchain/chat-langchain/app/utils/constants.tsx/0 | {
"file_path": "chat-langchain/chat-langchain/app/utils/constants.tsx",
"repo_id": "chat-langchain",
"token_count": 34
} | 8 |
import pytest
from llama_index.legacy.bridge.pydantic import BaseModel
from llama_index.legacy.output_parsers.base import OutputParserException
try:
from guidance.models import Mock as MockLLM
except ImportError:
MockLLM = None # type: ignore
from llama_index.legacy.program.guidance_program import GuidancePyd... | llama_index/llama-index-legacy/tests/program/test_guidance.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/program/test_guidance.py",
"repo_id": "llama_index",
"token_count": 307
} | 1,631 |
[mypy]
plugins = pydantic.mypy
| langsmith-sdk/python/mypy.ini/0 | {
"file_path": "langsmith-sdk/python/mypy.ini",
"repo_id": "langsmith-sdk",
"token_count": 14
} | 1,072 |
"""S3 file and directory reader.
A loader that fetches a file or iterates through a directory on AWS S3 or other compatible service.
"""
from typing import Dict, List, Optional, Union
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
from llama_index.readers.opendal.b... | llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/s3/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/s3/base.py",
"repo_id": "llama_index",
"token_count": 944
} | 1,410 |
from llama_index.core.llama_pack import BaseLlamaPack
from llama_index.packs.infer_retrieve_rerank import InferRetrieveRerankPack
def test_class():
names_of_base_classes = [b.__name__ for b in InferRetrieveRerankPack.__mro__]
assert BaseLlamaPack.__name__ in names_of_base_classes
| llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/tests/test_packs_infer_retrieve_rerank.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/tests/test_packs_infer_retrieve_rerank.py",
"repo_id": "llama_index",
"token_count": 109
} | 1,794 |
<jupyter_start><jupyter_text>Arthur [Arthur](https://arthur.ai) is a model monitoring and observability platform.The following guide shows how to run a registered chat LLM with the Arthur callback handler to automatically log model inferences to Arthur.If you do not have a model currently onboarded to Arthur, visit our... | langchain/docs/docs/integrations/providers/arthur_tracking.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/providers/arthur_tracking.ipynb",
"repo_id": "langchain",
"token_count": 926
} | 126 |
import { Serializable } from "./load/serializable.js";
import {
type BaseMessage,
HumanMessage,
getBufferString,
} from "./messages/index.js";
export interface BasePromptValueInterface extends Serializable {
toString(): string;
toChatMessages(): BaseMessage[];
}
export interface StringPromptValueInterface ... | langchainjs/langchain-core/src/prompt_values.ts/0 | {
"file_path": "langchainjs/langchain-core/src/prompt_values.ts",
"repo_id": "langchainjs",
"token_count": 1242
} | 899 |
# NIBittensor
LangChain.js offers experimental support for Neural Internet's Bittensor LLM models.
Here's an example:
import CodeBlock from "@theme/CodeBlock";
import NIBittensorExample from "@examples/models/llm/ni_bittensor.ts";
<CodeBlock language="typescript">{NIBittensorExample}</CodeBlock>
| langchainjs/docs/core_docs/docs/integrations/llms/ni_bittensor.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/llms/ni_bittensor.mdx",
"repo_id": "langchainjs",
"token_count": 93
} | 707 |
# 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/focalnet/configuration_focalnet.py/0 | {
"file_path": "transformers/src/transformers/models/focalnet/configuration_focalnet.py",
"repo_id": "transformers",
"token_count": 3131
} | 605 |
"""
**Utility functions** for LangChain.
These functions do not depend on any other LangChain module.
"""
from langchain_core.utils import image
from langchain_core.utils.env import get_from_dict_or_env, get_from_env
from langchain_core.utils.formatting import StrictFormatter, formatter
from langchain_core.utils.inpu... | langchain/libs/core/langchain_core/utils/__init__.py/0 | {
"file_path": "langchain/libs/core/langchain_core/utils/__init__.py",
"repo_id": "langchain",
"token_count": 523
} | 425 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-metal/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-metal/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,336 |
<!--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/xmod.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/xmod.md",
"repo_id": "transformers",
"token_count": 1496
} | 470 |
import { StringOutputParser } from "@langchain/core/output_parsers";
import { ChatPromptTemplate, PromptTemplate } from "@langchain/core/prompts";
import { RunnableSequence } from "@langchain/core/runnables";
import { ChatOpenAI } from "@langchain/openai";
import { createSqlQueryChain } from "langchain/chains/sql_db";
... | langchainjs/examples/src/use_cases/sql/query_checking.ts/0 | {
"file_path": "langchainjs/examples/src/use_cases/sql/query_checking.ts",
"repo_id": "langchainjs",
"token_count": 1523
} | 920 |
from text_generation_server.utils.hub import (
download_weights,
weight_hub_files,
weight_files,
)
from text_generation_server.utils.convert import convert_files
def test_convert_files():
model_id = "bigscience/bloom-560m"
pt_filenames = weight_hub_files(model_id, extension=".bin")
local_pt_f... | text-generation-inference/server/tests/utils/test_convert.py/0 | {
"file_path": "text-generation-inference/server/tests/utils/test_convert.py",
"repo_id": "text-generation-inference",
"token_count": 259
} | 441 |
/* eslint-disable no-process-env */
import { test } from "@jest/globals";
import { createClient } from "@supabase/supabase-js";
import { Document } from "@langchain/core/documents";
import { OpenAIEmbeddings, OpenAI } from "@langchain/openai";
import {
SupabaseFilter,
SupabaseVectorStore,
} from "@langchain/communi... | langchainjs/langchain/src/retrievers/self_query/tests/supabase_self_query.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/retrievers/self_query/tests/supabase_self_query.int.test.ts",
"repo_id": "langchainjs",
"token_count": 6933
} | 1,011 |
.. _Ref-Query-Engines:
Query Engines
=================
Below we show some general query engine classes.
.. toctree::
:maxdepth: 1
:caption: General Query Engines
query_engines/graph_query_engine.rst
query_engines/multistep_query_engine.rst
query_engines/retriever_query_engine.rst
query_engines/tra... | llama_index/docs/api_reference/query/query_engines.rst/0 | {
"file_path": "llama_index/docs/api_reference/query/query_engines.rst",
"repo_id": "llama_index",
"token_count": 326
} | 1,093 |
# coding=utf-8
# Copyright 2019 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/test_configuration_common.py/0 | {
"file_path": "transformers/tests/test_configuration_common.py",
"repo_id": "transformers",
"token_count": 2863
} | 858 |
# Copyright 2024 Google Brain 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 requ... | diffusers/src/diffusers/schedulers/scheduling_sde_ve_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_sde_ve_flax.py",
"repo_id": "diffusers",
"token_count": 4804
} | 273 |
---
sidebar_class_name: hidden
---
# LangChain Expression Language (LCEL)
LangChain Expression Language, or LCEL, is a declarative way to easily compose chains together.
LCEL was designed from day 1 to **support putting prototypes in production, with no code changes**, from the simplest “prompt + LLM” chain to the mo... | langchain/docs/docs/expression_language/index.mdx/0 | {
"file_path": "langchain/docs/docs/expression_language/index.mdx",
"repo_id": "langchain",
"token_count": 670
} | 91 |
from typing import Dict, List
from langchain_community.agent_toolkits.base import BaseToolkit
from langchain_community.tools import BaseTool
from langchain_community.tools.jira.prompt import (
JIRA_CATCH_ALL_PROMPT,
JIRA_CONFLUENCE_PAGE_CREATE_PROMPT,
JIRA_GET_ALL_PROJECTS_PROMPT,
JIRA_ISSUE_CREATE_PRO... | langchain/libs/community/langchain_community/agent_toolkits/jira/toolkit.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/jira/toolkit.py",
"repo_id": "langchain",
"token_count": 1136
} | 210 |
import { test, expect } from "@jest/globals";
import { Embeddings } from "@langchain/core/embeddings";
import { CacheBackedEmbeddings } from "../cache_backed.js";
import { InMemoryStore } from "../../storage/in_memory.js";
class RandomEmbeddings extends Embeddings {
async embedDocuments(documents: string[]): Promise... | langchainjs/langchain/src/embeddings/tests/cache.test.ts/0 | {
"file_path": "langchainjs/langchain/src/embeddings/tests/cache.test.ts",
"repo_id": "langchainjs",
"token_count": 360
} | 903 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,514 |
# init
from llama_index.tools.vector_db.base import (
VectorDB,
VectorDBToolSpec,
)
__all__ = ["VectorDB", "VectorDBToolSpec"]
| llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/llama_index/tools/vector_db/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/llama_index/tools/vector_db/__init__.py",
"repo_id": "llama_index",
"token_count": 53
} | 1,441 |
from llama_index.readers.microsoft_onedrive.base import OneDriveReader
__all__ = ["OneDriveReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/llama_index/readers/microsoft_onedrive/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/llama_index/readers/microsoft_onedrive/__init__.py",
"repo_id": "llama_index",
"token_count": 31
} | 1,521 |
from langchain.pydantic_v1 import BaseModel
from .router import branched_chain
class ChainInput(BaseModel):
message: str
chain = branched_chain.with_types(input_type=ChainInput)
| langchain/templates/cohere-librarian/cohere_librarian/chain.py/0 | {
"file_path": "langchain/templates/cohere-librarian/cohere_librarian/chain.py",
"repo_id": "langchain",
"token_count": 63
} | 705 |
use libc::size_t;
#[repr(C)]
pub struct RustArray {
array: *mut u32,
len: size_t,
cap: size_t,
}
impl RustArray {
pub fn from_vec(vec: Vec<u32>) -> RustArray {
let len = vec.len();
let cap = vec.capacity();
let v = vec.leak();
RustArray {
array: v.as_mut_ptr... | milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/array.rs/0 | {
"file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/array.rs",
"repo_id": "milvus",
"token_count": 288
} | 1,948 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querynodev2/delegator/deletebuffer/delete_buffer.go/0 | {
"file_path": "milvus/internal/querynodev2/delegator/deletebuffer/delete_buffer.go",
"repo_id": "milvus",
"token_count": 1194
} | 1,763 |
{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@headlessui... | opengpts/frontend/package.json/0 | {
"file_path": "opengpts/frontend/package.json",
"repo_id": "opengpts",
"token_count": 731
} | 2,021 |
from llama_index.vector_stores.astra.base import AstraDBVectorStore
__all__ = ["AstraDBVectorStore"]
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-astra/llama_index/vector_stores/astra/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-astra/llama_index/vector_stores/astra/__init__.py",
"repo_id": "llama_index",
"token_count": 34
} | 1,469 |
from langchain_community.callbacks.utils import (
BaseMetadataCallbackHandler,
_flatten_dict,
flatten_dict,
hash_string,
import_pandas,
import_spacy,
import_textstat,
load_json,
)
__all__ = [
"import_spacy",
"import_pandas",
"import_textstat",
"_flatten_dict",
"flatt... | langchain/libs/langchain/langchain/callbacks/utils.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/utils.py",
"repo_id": "langchain",
"token_count": 177
} | 484 |
# List of system prompts from Azure AI Studio
SHAKESPEARE_WRITING_ASSISTANT = """\
You are a Shakespearean writing assistant who speaks in a Shakespearean style. \
You help people come up with creative ideas and content like stories, poems, \
and songs that use Shakespearean style of writing style, including words lik... | llama_index/llama-index-legacy/llama_index/legacy/prompts/system.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/prompts/system.py",
"repo_id": "llama_index",
"token_count": 1176
} | 1,752 |
# Module Guides
```{toctree}
---
maxdepth: 1
---
/examples/pipeline/query_pipeline.ipynb
/examples/pipeline/query_pipeline_async.ipynb
/examples/pipeline/query_pipeline_pandas.ipynb
/examples/pipeline/query_pipeline_sql.ipynb
/examples/agent/agent_runner/query_pipeline_agent.ipynb
```
| llama_index/docs/module_guides/querying/pipeline/modules.md/0 | {
"file_path": "llama_index/docs/module_guides/querying/pipeline/modules.md",
"repo_id": "llama_index",
"token_count": 128
} | 1,097 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/whisper/feature_extraction_whisper.py/0 | {
"file_path": "transformers/src/transformers/models/whisper/feature_extraction_whisper.py",
"repo_id": "transformers",
"token_count": 5404
} | 676 |
# Generated content DO NOT EDIT
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence
from os import PathLike
from candle.typing import _ArrayLike, Device, Scalar, Index, Shape
from candle import Tensor, DType, QTensor
@staticmethod
def cuda_is_available() -> bool:
"""
Returns true if ... | candle/candle-pyo3/py_src/candle/utils/__init__.pyi/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/utils/__init__.pyi",
"repo_id": "candle",
"token_count": 712
} | 62 |
from langchain_community.vectorstores.pgvector import (
DistanceStrategy,
PGVector,
)
__all__ = [
"DistanceStrategy",
"PGVector",
]
| langchain/libs/langchain/langchain/vectorstores/pgvector.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/pgvector.py",
"repo_id": "langchain",
"token_count": 57
} | 605 |
<!---
Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | datasets/docs/README.md/0 | {
"file_path": "datasets/docs/README.md",
"repo_id": "datasets",
"token_count": 3059
} | 119 |
/*
* 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... | milvus/pkg/mq/msgstream/msg_for_collection.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/msg_for_collection.go",
"repo_id": "milvus",
"token_count": 1609
} | 1,827 |
from __future__ import annotations
from typing import TYPE_CHECKING, List, Literal, Optional
from langchain_core.pydantic_v1 import root_validator
from langchain_community.agent_toolkits.base import BaseToolkit
from langchain_community.tools import BaseTool
from langchain_community.tools.ainetwork.app import AINAppO... | langchain/libs/community/langchain_community/agent_toolkits/ainetwork/toolkit.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/ainetwork/toolkit.py",
"repo_id": "langchain",
"token_count": 637
} | 220 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/dpt/configuration_dpt.py/0 | {
"file_path": "transformers/src/transformers/models/dpt/configuration_dpt.py",
"repo_id": "transformers",
"token_count": 5770
} | 655 |
#!/usr/bin/env python
# coding=utf-8
# Copyright The HuggingFace Team 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.ap... | transformers/examples/pytorch/translation/run_translation_no_trainer.py/0 | {
"file_path": "transformers/examples/pytorch/translation/run_translation_no_trainer.py",
"repo_id": "transformers",
"token_count": 13559
} | 534 |
# DenseNet
**DenseNet** is a type of convolutional neural network that utilises dense connections between layers, through [Dense Blocks](http://www.paperswithcode.com/method/dense-block), where we connect *all layers* (with matching feature-map sizes) directly with each other. To preserve the feed-forward nature, each... | pytorch-image-models/docs/models/.templates/models/densenet.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/densenet.md",
"repo_id": "pytorch-image-models",
"token_count": 3382
} | 344 |
[tool.poetry]
name = "rag-google-cloud-vertexai-search"
version = "0.0.1"
description = "RAG using Google Vertex AI Search"
authors = ["Juan Calvo <juan.calvo@datatonic.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
google-cloud-aiplatform = ">=1.35.0"
[tool.poetry.... | langchain/templates/rag-google-cloud-vertexai-search/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-google-cloud-vertexai-search/pyproject.toml",
"repo_id": "langchain",
"token_count": 310
} | 717 |
[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 = ["LongLLMLinguaPostprocessor"]
contains_example = false
import_path = "llama_index.postproc... | llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-longllmlingua/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-longllmlingua/pyproject.toml",
"repo_id": "llama_index",
"token_count": 646
} | 1,316 |
from typing import Any, Dict, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Extra, root_validator
from langchain_core.utils import get_from_dict_or_env
from langchain_comm... | langchain/libs/community/langchain_community/llms/writer.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/writer.py",
"repo_id": "langchain",
"token_count": 2093
} | 275 |
// 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/MinioChunkManager.cpp/0 | {
"file_path": "milvus/internal/core/src/storage/MinioChunkManager.cpp",
"repo_id": "milvus",
"token_count": 11138
} | 1,773 |
from typing import Any, Dict, List, Optional
from llama_index.legacy.bridge.pydantic import Field, PrivateAttr
from llama_index.legacy.callbacks.base import CallbackManager
from llama_index.legacy.constants import DEFAULT_EMBED_BATCH_SIZE
from llama_index.legacy.core.embeddings.base import BaseEmbedding, Embedding
fro... | llama_index/llama-index-legacy/llama_index/legacy/embeddings/sagemaker_embedding_endpoint.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/sagemaker_embedding_endpoint.py",
"repo_id": "llama_index",
"token_count": 2465
} | 1,511 |
"""Util that calls Arxiv."""
import logging
import os
import re
from typing import Any, Dict, List, Optional
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import BaseModel, root_validator
logger = logging.getLogger(__name__)
class ArxivAPIWrapper(BaseModel):
"""Wrapper around Arx... | langchain/libs/community/langchain_community/utilities/arxiv.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/arxiv.py",
"repo_id": "langchain",
"token_count": 4533
} | 297 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/pkg/util/hardware/container_windows.go/0 | {
"file_path": "milvus/pkg/util/hardware/container_windows.go",
"repo_id": "milvus",
"token_count": 252
} | 2,106 |
from __future__ import annotations
from langchain_community.callbacks.manager import (
get_openai_callback,
wandb_tracing_enabled,
)
from langchain_core.callbacks.manager import (
AsyncCallbackManager,
AsyncCallbackManagerForChainGroup,
AsyncCallbackManagerForChainRun,
AsyncCallbackManagerForLL... | langchain/libs/langchain/langchain/callbacks/manager.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/manager.py",
"repo_id": "langchain",
"token_count": 668
} | 449 |
# Copyright 2024 UC Berkeley Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/examples/community/scheduling_ufogen.py/0 | {
"file_path": "diffusers/examples/community/scheduling_ufogen.py",
"repo_id": "diffusers",
"token_count": 10908
} | 206 |
#!/usr/bin/env python
# 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
#
# Unles... | accelerate/src/accelerate/commands/config/update.py/0 | {
"file_path": "accelerate/src/accelerate/commands/config/update.py",
"repo_id": "accelerate",
"token_count": 774
} | 8 |
import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
import {
AsyncCaller,
AsyncCallerCallOptions,
} from "@langchain/core/utils/async_caller";
import { getRuntimeEnvironment } from "@langchain/core/utils/env";
import type {
GoogleAIBaseLLMInput,
GoogleAIModelParams,
GoogleConn... | langchainjs/libs/langchain-google-common/src/connection.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-common/src/connection.ts",
"repo_id": "langchainjs",
"token_count": 2677
} | 1,033 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_import_structure = {}
try:
if not (is_transformers_available() and is... | diffusers/src/diffusers/pipelines/kandinsky/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/kandinsky/__init__.py",
"repo_id": "diffusers",
"token_count": 951
} | 249 |
<jupyter_start><jupyter_text>Human as a toolHuman are AGI so they can certainly be used as a tool to help out AI agent when it is confused.<jupyter_code>from langchain.agents import AgentType, initialize_agent, load_tools
from langchain_openai import ChatOpenAI, OpenAI
llm = ChatOpenAI(temperature=0.0)
math_llm = Open... | langchain/docs/docs/integrations/tools/human_tools.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/human_tools.ipynb",
"repo_id": "langchain",
"token_count": 856
} | 176 |
# Copyright 2022 The HuggingFace Team and Brian Chao. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | accelerate/src/accelerate/commands/menu/keymap.py/0 | {
"file_path": "accelerate/src/accelerate/commands/menu/keymap.py",
"repo_id": "accelerate",
"token_count": 2054
} | 9 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
API_PLANNER_PROMPT = """You are a planner that plans a sequence of API calls to assist with user queries against an API.
You should:
1) evaluate whether the user query can be solved by the API documentated below. If no, say why.
2) if yes, gene... | langchain/libs/community/langchain_community/agent_toolkits/openapi/planner_prompt.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/openapi/planner_prompt.py",
"repo_id": "langchain",
"token_count": 3165
} | 214 |
<jupyter_start><jupyter_text>Multi-Document AgentsIn this guide, you learn towards setting up an agent that can effectively answer different types of questions over a larger set of documents.These questions include the following- QA over a specific doc- QA comparing different docs- Summaries over a specific doc- Compar... | llama_index/docs/examples/agent/multi_document_agents.ipynb/0 | {
"file_path": "llama_index/docs/examples/agent/multi_document_agents.ipynb",
"repo_id": "llama_index",
"token_count": 3679
} | 1,091 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.