Skip to content

Commit

Permalink
Format, use BaseLanguageModel instead of BaseChatModel
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 18, 2025
1 parent 724bd5f commit 69f51c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/src/tools/google_calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function run() {

const calendarAgent = createReactAgent({
llm: model,
tools
tools,
});

const createInput = `Create a meeting with John Doe next Friday at 4pm - adding to the agenda of it the result of 99 + 99`;
Expand Down
6 changes: 3 additions & 3 deletions libs/langchain-community/src/tools/google_calendar/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { google } from "googleapis";
import { Tool } from "@langchain/core/tools";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { BaseLanguageModel } from "@langchain/core/language_models/base";

export interface GoogleCalendarAgentParams {
credentials?: {
Expand All @@ -10,7 +10,7 @@ export interface GoogleCalendarAgentParams {
calendarId?: string;
};
scopes?: string[];
model?: BaseChatModel;
model?: BaseLanguageModel;
}

export class GoogleCalendarBase extends Tool {
Expand All @@ -27,7 +27,7 @@ export class GoogleCalendarBase extends Tool {

protected scopes: string[];

protected llm: BaseChatModel;
protected llm: BaseLanguageModel;

constructor(
fields: GoogleCalendarAgentParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { google, calendar_v3 } from "googleapis";
import type { JWT, GaxiosResponse } from "googleapis-common";
import { PromptTemplate } from "@langchain/core/prompts";
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { BaseLanguageModel } from "@langchain/core/language_models/base";
import { StringOutputParser } from "@langchain/core/output_parsers";
import { CREATE_EVENT_PROMPT } from "../prompts/index.js";
import { getTimezoneOffsetInHours } from "../utils/get-timezone-offset-in-hours.js";
Expand Down Expand Up @@ -61,7 +61,7 @@ const createEvent = async (
type RunCreateEventParams = {
calendarId: string;
auth: JWT;
model: BaseChatModel;
model: BaseLanguageModel;
};

const runCreateEvent = async (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { calendar_v3 } from "googleapis";
import type { JWT } from "googleapis-common";
import { PromptTemplate } from "@langchain/core/prompts";
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { BaseLanguageModel } from "@langchain/core/language_models/base";
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
import { StringOutputParser } from "@langchain/core/output_parsers";

Expand All @@ -11,7 +11,7 @@ import { getTimezoneOffsetInHours } from "../utils/get-timezone-offset-in-hours.
type RunViewEventParams = {
calendarId: string;
auth: JWT;
model: BaseChatModel;
model: BaseLanguageModel;
};

const runViewEvents = async (
Expand Down

0 comments on commit 69f51c7

Please sign in to comment.