Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 25, 2025
1 parent 342df3b commit 7413b01
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 113 deletions.
2 changes: 1 addition & 1 deletion examples/src/embeddings/cache_backed_in_memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const cacheBackedEmbeddings = CacheBackedEmbeddings.fromBytesStore(
underlyingEmbeddings,
inMemoryStore,
{
namespace: underlyingEmbeddings.modelName,
namespace: underlyingEmbeddings.model,
}
);

Expand Down
2 changes: 1 addition & 1 deletion examples/src/embeddings/cache_backed_redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const cacheBackedEmbeddings = CacheBackedEmbeddings.fromBytesStore(
underlyingEmbeddings,
redisStore,
{
namespace: underlyingEmbeddings.modelName,
namespace: underlyingEmbeddings.model,
}
);

Expand Down
2 changes: 1 addition & 1 deletion examples/src/embeddings/convex/cache_backed_convex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ask = action({
underlyingEmbeddings,
new ConvexKVStore({ ctx }),
{
namespace: underlyingEmbeddings.modelName,
namespace: underlyingEmbeddings.model,
}
);

Expand Down
99 changes: 0 additions & 99 deletions examples/src/guides/evaluation/agent_trajectory/trajectory.ts

This file was deleted.

11 changes: 0 additions & 11 deletions examples/src/models/llm/openai_basePath.ts

This file was deleted.

4 changes: 4 additions & 0 deletions libs/langchain-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,9 @@ export class ChatOpenAI<

logitBias?: Record<string, number>;

/** @deprecated Use "model" instead */
modelName: string;

model = "gpt-3.5-turbo";

modelKwargs?: OpenAIChatInput["modelKwargs"];
Expand Down Expand Up @@ -1114,6 +1117,7 @@ export class ChatOpenAI<
getEnvironmentVariable("OPENAI_ORGANIZATION");

this.model = fields?.model ?? fields?.modelName ?? this.model;
this.modelName = this.model;
this.modelKwargs = fields?.modelKwargs ?? {};
this.timeout = fields?.timeout;

Expand Down
4 changes: 4 additions & 0 deletions libs/langchain-openai/src/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export class OpenAIEmbeddings
{
model = "text-embedding-ada-002";

/** @deprecated Use "model" instead */
modelName: string;

batchSize = 512;

// TODO: Update to `false` on next minor release (see: https://github.com/langchain-ai/langchainjs/pull/3612)
Expand Down Expand Up @@ -114,6 +117,7 @@ export class OpenAIEmbeddings

this.model =
fieldsWithDefaults?.model ?? fieldsWithDefaults?.modelName ?? this.model;
this.modelName = this.model;
this.batchSize = fieldsWithDefaults?.batchSize ?? this.batchSize;
this.stripNewLines =
fieldsWithDefaults?.stripNewLines ?? this.stripNewLines;
Expand Down
4 changes: 4 additions & 0 deletions libs/langchain-openai/src/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ export class OpenAI<CallOptions extends OpenAICallOptions = OpenAICallOptions>

model = "gpt-3.5-turbo-instruct";

/** @deprecated Use "model" instead */
modelName: string;

modelKwargs?: OpenAIInput["modelKwargs"];

batchSize = 20;
Expand Down Expand Up @@ -175,6 +178,7 @@ export class OpenAI<CallOptions extends OpenAICallOptions = OpenAICallOptions>
].join("\n")
);
}
this.modelName = this.model;
this.modelKwargs = fields?.modelKwargs ?? {};
this.batchSize = fields?.batchSize ?? this.batchSize;
this.timeout = fields?.timeout;
Expand Down
12 changes: 12 additions & 0 deletions libs/langchain-openai/src/tests/chat_models.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1227,3 +1227,15 @@ test("Allows developer messages with o1", async () => {
]);
expect(res.content).toEqual("testing");
});

test.only("", async () => {

Check failure on line 1231 in libs/langchain-openai/src/tests/chat_models.int.test.ts

View workflow job for this annotation

GitHub Actions / Check linting

Unexpected focused test
class ChatDeepseek extends ChatOpenAI {}
const model = new ChatDeepseek({
configuration: {
baseURL: "https://api.deepseek.com",
},
apiKey: process.env.DEEPSEEK_API_KEY,
model: "deepseek-reasoner",
});
const res = await model.invoke("why is the sky blue");
});

0 comments on commit 7413b01

Please sign in to comment.