Skip to content

Commit

Permalink
Move ModelConfig to types
Browse files Browse the repository at this point in the history
  • Loading branch information
punitda committed Nov 4, 2024
1 parent 04879b2 commit d925dd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/agent/utils.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { isArtifactCodeContent } from "@/lib/artifact_content_types";
import { BaseStore, LangGraphRunnableConfig } from "@langchain/langgraph";
import { ArtifactCodeV3, ArtifactMarkdownV3, Reflections } from "../types";
import {
ArtifactCodeV3,
ArtifactMarkdownV3,
Reflections,
ModelConfig,
} from "../types";
import { initChatModel } from "langchain/chat_models/universal";

type ModelConfig = {
temperature?: number;
modelProvider: string;
maxTokens?: number;
azureConfig?: {
azureOpenAIApiKey: string;
azureOpenAIApiInstanceName: string;
azureOpenAIApiDeploymentName: string;
azureOpenAIApiVersion: string;
};
};

/**
* Wrapper around initChatModel
*/
Expand Down
13 changes: 13 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,16 @@ export type RewriteArtifactMetaToolResponse =
title: string;
language: ProgrammingLanguageOptions;
};

export interface ModelConfig {
temperature?: number;
modelProvider: string;
maxTokens?: number;
azureConfig?: {
azureOpenAIApiKey: string;
azureOpenAIApiInstanceName: string;
azureOpenAIApiDeploymentName: string;
azureOpenAIApiVersion: string;
azureOpenAIBasePath?: string;
};
}

0 comments on commit d925dd5

Please sign in to comment.