Skip to content

Commit

Permalink
Remove unnecessary protected keyword in a few places (langchain-ai#743
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nfcampos authored Apr 11, 2023
1 parent 1d6aa50 commit 98d32f3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions langchain/src/agents/agent_toolkits/zapier/zapier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { ZapierNLARunAction, ZapierNLAWrapper } from "../../../tools/zapier.js";
export class ZapierToolKit extends Toolkit {
tools: Tool[] = [];

protected constructor() {
super();
}

static async fromZapierNLAWrapper(
zapierNLAWrapper: ZapierNLAWrapper
): Promise<ZapierToolKit> {
Expand Down
4 changes: 2 additions & 2 deletions langchain/src/base_language/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export abstract class BaseLanguageModel implements BaseLanguageModelParams {
* The async caller should be used by subclasses to make any async calls,
* which will thus benefit from the concurrency and retry logic.
*/
protected caller: AsyncCaller;
caller: AsyncCaller;

protected constructor(params: BaseLanguageModelParams) {
constructor(params: BaseLanguageModelParams) {
this.verbose =
params.verbose ?? (params.callbackManager ? true : getVerbosity());
this.callbackManager = params.callbackManager ?? getCallbackManager();
Expand Down
4 changes: 2 additions & 2 deletions langchain/src/chat_models/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export type SerializedLLM = {
export type BaseChatModelParams = BaseLanguageModelParams;

export abstract class BaseChatModel extends BaseLanguageModel {
protected constructor({ ...rest }: BaseChatModelParams) {
super(rest);
constructor(fields: BaseChatModelParams) {
super(fields);
}

abstract _combineLLMOutput?(
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/embeddings/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export abstract class Embeddings {
* The async caller should be used by subclasses to make any async calls,
* which will thus benefit from the concurrency and retry logic.
*/
protected caller: AsyncCaller;
caller: AsyncCaller;

constructor(params: EmbeddingsParams) {
this.caller = new AsyncCaller(params ?? {});
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/retrievers/remote/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export abstract class RemoteRetriever

asyncCaller: AsyncCaller;

protected constructor({ url, auth, ...rest }: RemoteRetrieverParams) {
constructor({ url, auth, ...rest }: RemoteRetrieverParams) {
super();
this.url = url;
this.auth = auth;
Expand Down
2 changes: 2 additions & 0 deletions test-exports-vercel/src/pages/api/hello-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { OpenAI } from "langchain/llms/openai";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { CallbackManager } from "langchain/callbacks";
import { ChatAgent } from "langchain/agents";

import { NextRequest, NextResponse } from "next/server";

Expand All @@ -26,6 +27,7 @@ export default async function handler(req: NextRequest) {
const emb = new OpenAIEmbeddings({
openAIApiKey: process.env.OPENAI_API_KEY,
});
const agent = ChatAgent.fromLLMAndTools(new ChatOpenAI(), []);

// Set up a streaming LLM
const encoder = new TextEncoder();
Expand Down

0 comments on commit 98d32f3

Please sign in to comment.