Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openai[patch],anthropic[patch]: Improve args section of jsdoc #6473

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions libs/langchain-anthropic/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,28 @@ function extractToken(chunk: AIMessageChunk): string | undefined {
* export ANTHROPIC_API_KEY="your-api-key"
* ```
*
* ## Key args
* ## [Constructor args](/classes/langchain_anthropic.ChatAnthropic.html#constructor)
*
* ### [Init args](/classes/langchain_anthropic.ChatAnthropic.html#constructor)
* ## [Runtime args](/interfaces/langchain_anthropic.ChatAnthropicCallOptions.html)
*
* ### [Runtime args](/interfaces/langchain_anthropic.ChatAnthropicCallOptions.html)
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
* They can also be passed via `.bind`, or the second arg in `.bindTools`, like shown in the examples below:
*
* > See full list of supported init args and their descriptions in the [`constructor`](/classes/langchain_anthropic.ChatAnthropic.html#constructor) section.
* ```typescript
* // When calling `.bind`, call options should be passed via the first argument
* const llmWithArgsBound = llm.bind({
* stop: ["\n"],
* tools: [...],
* });
*
* // When calling `.bindTools`, call options should be passed via the second argument
* const llmWithTools = llm.bindTools(
* [...],
* {
* tool_choice: "auto",
* }
* );
* ```
*
* ## Examples
*
Expand Down
23 changes: 19 additions & 4 deletions libs/langchain-openai/src/azure/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ import {
* export AZURE_OPENAI_BASE_PATH="your-base-path"
* ```
*
* ## Key args
* ## [Constructor args](/classes/langchain_openai.AzureChatOpenAI.html#constructor)
*
* ### [Init args](/classes/langchain_openai.AzureChatOpenAI.html#constructor)
* ## [Runtime args](/interfaces/langchain_openai.ChatOpenAICallOptions.html)
*
* ### [Runtime args](/interfaces/langchain_openai.ChatOpenAICallOptions.html)
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
* They can also be passed via `.bind`, or the second arg in `.bindTools`, like shown in the examples below:
*
* > See full list of supported init args and their descriptions in the [`constructor`](/classes/langchain_openai.AzureChatOpenAI.html#constructor) section.
* ```typescript
* // When calling `.bind`, call options should be passed via the first argument
* const llmWithArgsBound = llm.bind({
* stop: ["\n"],
* tools: [...],
* });
*
* // When calling `.bindTools`, call options should be passed via the second argument
* const llmWithTools = llm.bindTools(
* [...],
* {
* tool_choice: "auto",
* }
* );
* ```
*
* ## Examples
*
Expand Down
23 changes: 19 additions & 4 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,28 @@ export interface ChatOpenAIFields
* export OPENAI_API_KEY="your-api-key"
* ```
*
* ## Key args
* ## [Constructor args](/classes/langchain_openai.ChatOpenAI.html#constructor)
*
* ### [Init args](/classes/langchain_openai.ChatOpenAI.html#constructor)
* ## [Runtime args](/interfaces/langchain_openai.ChatOpenAICallOptions.html)
*
* ### [Runtime args](/interfaces/langchain_openai.ChatOpenAICallOptions.html)
* Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
* They can also be passed via `.bind`, or the second arg in `.bindTools`, like shown in the examples below:
*
* > See full list of supported init args and their descriptions in the [`constructor`](/classes/langchain_openai.ChatOpenAI.html#constructor) section.
* ```typescript
* // When calling `.bind`, call options should be passed via the first argument
* const llmWithArgsBound = llm.bind({
* stop: ["\n"],
* tools: [...],
* });
*
* // When calling `.bindTools`, call options should be passed via the second argument
* const llmWithTools = llm.bindTools(
* [...],
* {
* tool_choice: "auto",
* }
* );
* ```
*
* ## Examples
*
Expand Down
Loading