Skip to content

Commit

Permalink
Update serde interfaces after removing handling of paths, make hn tes…
Browse files Browse the repository at this point in the history
…t an int test, fix some docs (langchain-ai#736)
  • Loading branch information
nfcampos authored Apr 11, 2023
1 parent 47539da commit 1d6aa50
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_class_name: node-only-category
Only available on Node.js.
:::

These loaders are used to load files either given a file path or a Blob object.
These loaders are used to load files given a filesystem path or a Blob object.

import DocCardList from "@theme/DocCardList";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sidebar_position: 3
hide_table_of_contents: true
sidebar_class_name: node-only
sidebar_label: Playwright
---

# Webpages, with Playwright
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Remote Retriever
# Databerry Retriever

This example shows how to use the Databerry Retriever in a `RetrievalQAChain` to retrieve documents from a Databerry.ai datastore.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sidebar_class_name: node-only

# Milvus

[Milvus](https://milvus.io/) is an vector database built for embedding similarity search and AI applications.
[Milvus](https://milvus.io/) is a vector database built for embeddings similarity search and AI applications.

:::tip Compatibility
Only available on Node.js.
:::

## Setup

1. Run milvus instance inside of docker on your computer [docs](https://milvus.io/docs/v2.1.x/install_standalone-docker.md)
1. Run Milvus instance with Docker on your computer [docs](https://milvus.io/docs/v2.1.x/install_standalone-docker.md)
2. Install the Milvus Node.js SDK.

```bash npm2yarn
Expand Down
1 change: 0 additions & 1 deletion langchain/src/agents/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export type SerializedAgentT<
> = {
_type: TType;
llm_chain?: SerializedLLMChain;
llm_chain_path?: string;
} & (
| ({ load_from_llm_and_tools: true } & FromLLMInput)
| ({ load_from_llm_and_tools?: false } & ConstructorInput)
Expand Down
11 changes: 1 addition & 10 deletions langchain/src/chains/serde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,37 @@ import type { SerializedSqlDatabase } from "../util/sql_utils.js";
export type SerializedLLMChain = {
_type: "llm_chain";
llm?: SerializedLLM;
llm_path?: string;
prompt?: SerializedBasePromptTemplate;
prompt_path?: string;
};

export type SerializedSqlDatabaseChain = {
sql_database: SerializedSqlDatabase;
_type: "sql_database_chain";
sql_database: SerializedSqlDatabase;
llm: SerializedLLM;
sql_database_chain_path?: string;
};

export type SerializedVectorDBQAChain = {
_type: "vector_db_qa";
k: number;
combine_documents_chain: SerializedBaseChain;
combine_documents_chain_path?: string;
};

export type SerializedStuffDocumentsChain = {
_type: "stuff_documents_chain";
llm_chain?: SerializedLLMChain;
llm_chain_path?: string;
};

export type SerializedChatVectorDBQAChain = {
_type: "chat-vector-db";
k: number;
combine_documents_chain: SerializedBaseChain;
combine_documents_chain_path?: string;
question_generator: SerializedLLMChain;
};

export type SerializedMapReduceDocumentsChain = {
_type: "map_reduce_documents_chain";
llm_chain?: SerializedLLMChain;
llm_chain_path?: string;
combine_document_chain?: SerializedBaseChain;
combine_document_chain_path?: string;
};

export type SerializedRefineDocumentsChain = {
Expand All @@ -55,7 +47,6 @@ export type SerializedRefineDocumentsChain = {
export type SerializedAnalyzeDocumentChain = {
_type: "analyze_document_chain";
combine_document_chain?: SerializedBaseChain;
combine_document_chain_path?: string;
};

export type SerializedBaseChain =
Expand Down
4 changes: 0 additions & 4 deletions langchain/src/prompts/serde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ export type SerializedPromptTemplate = {
input_variables: string[];
template_format?: TemplateFormat;
template?: string;
template_path?: string;
};

export type SerializedFewShotTemplate = {
_type: "few_shot";
input_variables: string[];
examples: string | Example[];
example_prompt?: SerializedPromptTemplate;
example_prompt_path?: string;
example_separator: string;
prefix?: string;
prefix_path?: string;
suffix?: string;
suffix_path?: string;
template_format: TemplateFormat;
};

Expand Down

0 comments on commit 1d6aa50

Please sign in to comment.