Skip to content

Commit

Permalink
load prompts to slash commands correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Jan 23, 2025
1 parent 23f05b2 commit f1ea63f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function slashFromCustomCommand(
): SlashCommand {
return {
name: customCommand.name,
description: customCommand.description,
description: customCommand.description ?? "",
run: async function* ({ input, llm, history, ide }) {
// Remove slash command prefix from input
let userInput = input;
Expand Down
6 changes: 5 additions & 1 deletion core/config/yaml/loadYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { getConfigYamlPath } from "../../util/paths";
import { getSystemPromptDotFile } from "../getSystemPromptDotFile";
import { PlatformConfigMetadata } from "../profile/PlatformProfileLoader";

import { slashFromCustomCommand } from "../../commands";
import { allTools } from "../../tools";
import { clientRenderHelper } from "./clientRender";
import { llmsFromModelConfig } from "./models";
Expand Down Expand Up @@ -95,7 +96,10 @@ async function configYamlToContinueConfig(
allowFreeTrial: boolean = true,
): Promise<ContinueConfig> {
const continueConfig: ContinueConfig = {
slashCommands: await slashCommandsFromV1PromptFiles(ide),
slashCommands: [
...(await slashCommandsFromV1PromptFiles(ide)),
...(config.prompts?.map(slashFromCustomCommand) ?? []),
],
models: [],
tabAutocompleteModels: [],
tools: allTools,
Expand Down
2 changes: 1 addition & 1 deletion core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ export interface SlashCommandDescription {
export interface CustomCommand {
name: string;
prompt: string;
description: string;
description?: string;
}

export interface Prediction {
Expand Down

0 comments on commit f1ea63f

Please sign in to comment.