Skip to content

Commit

Permalink
type fix, yarn deduplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
CiaranMn committed Dec 16, 2024
1 parent 0f07b0d commit 67fb80a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ import { StatusCode } from "@local/status";
import { Context } from "@temporalio/activity";
import dedent from "dedent";
import { CodeInterpreter, Sandbox } from "e2b";
import { OpenAI } from "openai";
import type { OpenAI } from "openai";

import { logger } from "../shared/activity-logger.js";
import type { PermittedOpenAiModel } from "../shared/openai-client.js";
import { stringify } from "../shared/stringify.js";
import type { FlowActionActivity } from "./types.js";
import ChatCompletionUserMessageParam = OpenAI.ChatCompletionUserMessageParam;
import ChatCompletionToolMessageParam = OpenAI.ChatCompletionToolMessageParam;

import { getFlowContext } from "../shared/get-flow-context.js";
import { getLlmResponse } from "../shared/get-llm-response.js";
import {
Expand All @@ -37,6 +31,9 @@ import type { LlmToolDefinition } from "../shared/get-llm-response/types.js";
import { graphApiClient } from "../shared/graph-api-client.js";
import { mapActionInputEntitiesToEntities } from "../shared/map-action-input-entities-to-entities.js";
import { openAiSeed } from "../shared/open-ai-seed.js";
import type { PermittedOpenAiModel } from "../shared/openai-client.js";
import { stringify } from "../shared/stringify.js";
import type { FlowActionActivity } from "./types.js";

const answerTools: LlmToolDefinition[] = [
{
Expand Down Expand Up @@ -202,7 +199,7 @@ const callModel = async (

const toolCalls = getToolCallsFromLlmAssistantMessage({ message });

const responseMessages: ChatCompletionToolMessageParam[] = [];
const responseMessages: OpenAI.ChatCompletionToolMessageParam[] = [];

/**
* Defining these outside the loop so that in cases where the maximum iteration is reached,
Expand Down Expand Up @@ -384,7 +381,7 @@ const callModel = async (
);
}

const responseMessage: ChatCompletionUserMessageParam = {
const responseMessage: OpenAI.ChatCompletionUserMessageParam = {
role: "user",
content:
"You didn't make any valid tool calls as part of your response. Please review the tools available to you and use the appropriate one.",
Expand Down
24 changes: 1 addition & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37546,7 +37546,7 @@ __metadata:
languageName: node
linkType: hard

"openai@npm:4.76.2":
"openai@npm:4.76.2, openai@npm:^4.38.0":
version: 4.76.2
resolution: "openai@npm:4.76.2"
dependencies:
Expand All @@ -37568,28 +37568,6 @@ __metadata:
languageName: node
linkType: hard

"openai@npm:^4.38.0":
version: 4.73.1
resolution: "openai@npm:4.73.1"
dependencies:
"@types/node": "npm:^18.11.18"
"@types/node-fetch": "npm:^2.6.4"
abort-controller: "npm:^3.0.0"
agentkeepalive: "npm:^4.2.1"
form-data-encoder: "npm:1.7.2"
formdata-node: "npm:^4.3.2"
node-fetch: "npm:^2.6.7"
peerDependencies:
zod: ^3.23.8
peerDependenciesMeta:
zod:
optional: true
bin:
openai: bin/cli
checksum: 10c0/556b5ba76846fb6d0bacff1b708ec009034cf92f107d84f1d7962625a0d74bf63e7cdfa48b10faf279d6a2c1d3aaf7c68a23b88aa61539a6ba6a9ef8dda7fd35
languageName: node
linkType: hard

"openapi-sampler@npm:^1.5.0":
version: 1.6.0
resolution: "openapi-sampler@npm:1.6.0"
Expand Down

0 comments on commit 67fb80a

Please sign in to comment.