Skip to content

Commit

Permalink
Merge branch 'main' into brace/agent-stream-example
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul authored Dec 5, 2023
2 parents 251bcf6 + 752a145 commit cc9c2ae
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 133 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -114,7 +114,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn build --filter=langchain
run: yarn run build:deps && yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -154,7 +154,7 @@ jobs:
# - name: Install dependencies
# run: yarn install --immutable
# - name: Build
# run: yarn run build:deps && yarn build --filter=langchain
# run: yarn run build:deps && yarn workspace langchain build
# shell: bash
# env:
# SKIP_API_DOCS: true
Expand Down
6 changes: 2 additions & 4 deletions docs/api_refs/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@langchain/api_refs",
"name": "api_refs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
"typedoc": "npx typedoc --options typedoc.json",
"build:scripts": "node ./scripts/generate-api-refs.js && node ./scripts/update-typedoc-css.js",
"build": "yarn turbo run build --filter=@langchain/core --no-cache && yarn turbo run build:next",
"build:next": "next build",
"build": "yarn run build:deps && yarn workspace langchain build && yarn build:scripts && next build",
"start": "yarn build && next start -p 3001",
"lint": "next lint"
},
Expand All @@ -26,7 +25,6 @@
"postcss": "^8",
"tailwindcss": "^3.3.0",
"ts-morph": "^20.0.0",
"turbo": "latest",
"typescript": "^5"
}
}
14 changes: 0 additions & 14 deletions docs/api_refs/turbo.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Structured tool chat

:::info
If you are using a functions-capable model like ChatOpenAI, we currently recommend that you use the [OpenAI Functions agent](/docs/modules/agents/agent_types/openai_functions_agent)
for more complex tool calling.
:::

The structured tool chat agent is capable of using multi-input tools.

Older agents are configured to specify an action input as a single string, but this agent can use the provided tools' `args_schema` to populate the action input.
Expand Down
7 changes: 2 additions & 5 deletions docs/core_docs/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@langchain/core_docs",
"name": "core_docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "yarn build:typedoc && rimraf ./docs/api && NODE_OPTIONS=--max-old-space-size=7168 docusaurus start",
"rimraf:build": "rimraf ./build",
"build:docusaurus": "NODE_OPTIONS=--max-old-space-size=7168 DOCUSAURUS_SSR_CONCURRENCY=4 docusaurus build",
"build": "yarn turbo run build:docusaurus",
"build": "yarn build:typedoc && rimraf ./build && NODE_OPTIONS=--max-old-space-size=7168 DOCUSAURUS_SSR_CONCURRENCY=4 docusaurus build",
"build:typedoc": "cd ../api_refs && yarn build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand Down Expand Up @@ -48,7 +46,6 @@
"prettier": "^2.7.1",
"rimraf": "^5.0.1",
"swc-loader": "^0.2.3",
"turbo": "latest",
"typedoc": "^0.24.4",
"typedoc-plugin-markdown": "next"
},
Expand Down
13 changes: 0 additions & 13 deletions docs/core_docs/turbo.json

This file was deleted.

4 changes: 2 additions & 2 deletions langchain-core/src/callbacks/manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { v4 as uuidv4 } from "uuid";
import type { AgentAction, AgentFinish } from "../agents.js";
import { AgentAction, AgentFinish } from "../agents.js";
import type { ChainValues } from "../utils/types.js";
import type { LLMResult } from "../outputs.js";
import { LLMResult } from "../outputs.js";
import {
BaseCallbackHandler,
CallbackHandlerMethods,
Expand Down
8 changes: 4 additions & 4 deletions langchain-core/src/language_models/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import {
AIMessage,
BaseMessage,
BaseMessageChunk,
type BaseMessageLike,
BaseMessageLike,
HumanMessage,
coerceMessageLikeToMessage,
} from "../messages/index.js";
import { BasePromptValue } from "../prompt_values.js";
import {
type LLMResult,
LLMResult,
RUN_KEY,
type ChatGeneration,
ChatGeneration,
ChatGenerationChunk,
type ChatResult,
ChatResult,
} from "../outputs.js";
import {
BaseLanguageModel,
Expand Down
13 changes: 4 additions & 9 deletions langchain-core/src/language_models/llms.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { AIMessage, BaseMessage, getBufferString } from "../messages/index.js";
import { BasePromptValue } from "../prompt_values.js";
import { LLMResult, RUN_KEY, Generation, GenerationChunk } from "../outputs.js";
import {
type LLMResult,
RUN_KEY,
type Generation,
GenerationChunk,
} from "../outputs.js";
import {
type BaseCallbackConfig,
BaseCallbackConfig,
CallbackManager,
CallbackManagerForLLMRun,
type Callbacks,
Callbacks,
} from "../callbacks/manager.js";
import {
BaseLanguageModel,
type BaseLanguageModelCallOptions,
type BaseLanguageModelInput,
type BaseLanguageModelParams,
} from "./base.js";
import type { RunnableConfig } from "../runnables/config.js";
import { RunnableConfig } from "../runnables/config.js";

export type SerializedLLM = {
_model: string;
Expand Down
2 changes: 1 addition & 1 deletion langchain-core/src/messages/tests/base_message.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "@jest/globals";
import { ChatPromptTemplate } from "../../prompts/chat.js";
import { HumanMessage } from "../index.js";
import { HumanMessage } from "../../messages/index.js";

test("Test ChatPromptTemplate can format OpenAI content image messages", async () => {
const message = new HumanMessage({
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"packageManager": "[email protected]",
"scripts": {
"build": "turbo run build --filter=\"!test-exports-*\" --concurrency 1",
"build:deps": "yarn build --filter=@langchain/openai --filter=@langchain/anthropic --filter=@langchain/core",
"build:deps": "yarn workspace @langchain/core build && yarn workspace @langchain/anthropic build && yarn workspace @langchain/openai build",
"format": "turbo run format",
"format:check": "turbo run format:check",
"lint": "turbo run lint --concurrency 1",
"lint:fix": "yarn lint -- --fix",
"test": "yarn test:unit && yarn build --filter=langchain && yarn test:exports:docker",
"test": "yarn test:unit && yarn workspace @langchain/core build && yarn workspace langchain build && yarn test:exports:docker",
"test:unit": "turbo run test --filter @langchain/core --filter langchain",
"test:int": "yarn run test:int:deps && turbo run test:integration ; yarn run test:int:deps:down",
"test:int:deps": "docker compose -f test-int-deps-docker-compose.yml up -d",
Expand All @@ -34,8 +34,8 @@
"publish:core": "bash langchain/scripts/release-branch.sh && turbo run --filter @langchain/core build lint test --concurrency 1 && yarn run test:exports:docker && yarn workspace @langchain/core run release && echo 'πŸ”— Open https://github.com/langchain-ai/langchainjs/compare/release?expand=1 and merge the release PR'",
"example": "yarn workspace examples start",
"precommit": "turbo run precommit",
"docs": "yarn workspace @langchain/core_docs start",
"docs:api_refs": "yarn workspace @langchain/api_refs start"
"docs": "yarn workspace core_docs start",
"docs:api_refs": "yarn workspace api_refs start"
},
"author": "LangChain",
"license": "MIT",
Expand Down
16 changes: 1 addition & 15 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env"],
"pipeline": {
"@langchain/core#build": {
"outputs": [
"langchain-core/dist/**",
"langchain-core/dist-cjs/**",
"langchain-core/*.js",
"langchain-core/*.cjs",
"langchain-core/*.d.ts"
],
"inputs": [
"langchain-core/src/**",
"langchain-core/scripts/**",
"langchain-core/package.json",
"langchain-core/tsconfig.json"
]
},
"@langchain/core#build": {},
"libs/langchain-anthropic#build": {
"dependsOn": ["@langchain/core#build"]
},
Expand Down
Loading

0 comments on commit cc9c2ae

Please sign in to comment.