Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PromptWithOutputs type #508

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions typescript/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { extractOverrideSettings } from "./utils";
import { HuggingFaceTextGenerationParser } from "./parsers/hf";
import { CallbackEvent, CallbackManager } from "./callback";

export type PromptWithOutputs = Prompt & { outputs?: Output[] };

/**
* Options for saving an AIConfig to a file.
*/
Expand Down Expand Up @@ -72,7 +70,7 @@ export class AIConfigRuntime implements AIConfig {
description?: string | undefined;
schema_version: SchemaVersion;
metadata: AIConfig["metadata"];
prompts: PromptWithOutputs[];
prompts: Prompt[];

filePath?: string;
callbackManager: CallbackManager = CallbackManager.createManagerWithLogging();
Expand All @@ -82,7 +80,7 @@ export class AIConfigRuntime implements AIConfig {
description?: string,
schemaVersion: SchemaVersion = "latest",
metadata?: AIConfig["metadata"],
prompts?: PromptWithOutputs[]
prompts?: Prompt[]
) {
this.name = name;
this.description = description;
Expand Down Expand Up @@ -197,7 +195,7 @@ export class AIConfigRuntime implements AIConfig {
description?: string,
schemaVersion: SchemaVersion = "latest",
metadata?: AIConfig["metadata"],
prompts?: PromptWithOutputs[]
prompts?: Prompt[]
) {
return new AIConfigRuntime(
name,
Expand Down Expand Up @@ -396,7 +394,7 @@ export class AIConfigRuntime implements AIConfig {
`E1014: Unable to run prompt '${promptName}': ModelParser for model ${modelName} does not exist`
);
}

// Clear previous run outputs if they exist
this.deleteOutput(promptName);
const result = await modelParser.run(prompt, this, options, params);
Expand Down