Skip to content

Commit

Permalink
Format and deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jun 11, 2024
1 parent 63063d5 commit 3f89ad5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion langchain/src/chains/openai_moderation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class OpenAIModerationChain
this.throwError = fields?.throwError ?? false;
this.openAIApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.openAIApiKey ??
getEnvironmentVariable("OPENAI_API_KEY");

if (!this.openAIApiKey) {
Expand Down
3 changes: 2 additions & 1 deletion libs/langchain-azure-openai/src/chat_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export interface ChatOpenAICallOptions
seed?: number;
}

/** @deprecated Import from "@langchain/openai" instead. */
export class AzureChatOpenAI
extends BaseChatModel<ChatOpenAICallOptions>
implements OpenAIChatInput, AzureOpenAIInput
Expand Down Expand Up @@ -268,7 +269,7 @@ export class AzureChatOpenAI

const openAiApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.openAIApiKey ??
getEnvironmentVariable("OPENAI_API_KEY");

this.azureOpenAIApiKey =
Expand Down
3 changes: 2 additions & 1 deletion libs/langchain-azure-openai/src/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { chunkArray } from "@langchain/core/utils/chunk_array";
import { AzureOpenAIInput, AzureOpenAIEmbeddingsParams } from "./types.js";
import { USER_AGENT_PREFIX } from "./constants.js";

/** @deprecated Import from "@langchain/openai" instead. */
export class AzureOpenAIEmbeddings
extends Embeddings
implements AzureOpenAIEmbeddingsParams, AzureOpenAIInput
Expand Down Expand Up @@ -63,7 +64,7 @@ export class AzureOpenAIEmbeddings

const openAiApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.openAIApiKey ??
getEnvironmentVariable("OPENAI_API_KEY");

this.azureOpenAIApiKey =
Expand Down
3 changes: 2 additions & 1 deletion libs/langchain-azure-openai/src/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface TokenUsage {
totalTokens?: number;
}

/** @deprecated Import from "@langchain/openai" instead. */
export class AzureOpenAI<
CallOptions extends OpenAICallOptions = OpenAICallOptions
>
Expand Down Expand Up @@ -136,7 +137,7 @@ export class AzureOpenAI<

const openAiApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.openAIApiKey ??
getEnvironmentVariable("OPENAI_API_KEY");

this.azureOpenAIApiKey =
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain-openai/src/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class OpenAIChat

this.openAIApiKey =
fields?.apiKey ??
fields?.openAIApiKey ??
fields?.openAIApiKey ??
getEnvironmentVariable("OPENAI_API_KEY");

this.azureOpenAIApiKey =
Expand Down

0 comments on commit 3f89ad5

Please sign in to comment.