add mode config, fix app params
This commit is contained in:
parent
f282c9f667
commit
7791baabaa
@ -1,4 +1,7 @@
|
|||||||
releases:
|
releases:
|
||||||
|
- version: "0.2"
|
||||||
|
features:
|
||||||
|
- "add mode config, you can create mode config in _infio_prompts folder"
|
||||||
- version: "0.1.8"
|
- version: "0.1.8"
|
||||||
improvements:
|
improvements:
|
||||||
- "fix chat input command plugin"
|
- "fix chat input command plugin"
|
||||||
|
|||||||
@ -114,6 +114,7 @@ const Chat = forwardRef<ChatRef, ChatProps>((props, ref) => {
|
|||||||
const { streamResponse, chatModel } = useLLM()
|
const { streamResponse, chatModel } = useLLM()
|
||||||
|
|
||||||
const promptGenerator = useMemo(() => {
|
const promptGenerator = useMemo(() => {
|
||||||
|
// @ts-expect-error
|
||||||
return new PromptGenerator(getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList)
|
return new PromptGenerator(getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList)
|
||||||
}, [getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList])
|
}, [getRAGEngine, app, settings, diffStrategy, customModePrompts, customModeList])
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { App } from "obsidian"
|
||||||
|
|
||||||
import { addCustomInstructions } from "../core/prompts/sections/custom-instructions"
|
import { addCustomInstructions } from "../core/prompts/sections/custom-instructions"
|
||||||
|
|
||||||
import { ALWAYS_AVAILABLE_TOOLS, TOOL_GROUPS, ToolGroup } from "./tool-groups"
|
import { ALWAYS_AVAILABLE_TOOLS, TOOL_GROUPS, ToolGroup } from "./tool-groups"
|
||||||
@ -262,6 +264,7 @@ export async function getAllModesWithPrompts(): Promise<ModeConfig[]> {
|
|||||||
|
|
||||||
// Helper function to get complete mode details with all overrides
|
// Helper function to get complete mode details with all overrides
|
||||||
export async function getFullModeDetails(
|
export async function getFullModeDetails(
|
||||||
|
app: App,
|
||||||
modeSlug: string,
|
modeSlug: string,
|
||||||
customModes?: ModeConfig[],
|
customModes?: ModeConfig[],
|
||||||
customModePrompts?: CustomModePrompts,
|
customModePrompts?: CustomModePrompts,
|
||||||
@ -284,6 +287,7 @@ export async function getFullModeDetails(
|
|||||||
let fullCustomInstructions = baseCustomInstructions
|
let fullCustomInstructions = baseCustomInstructions
|
||||||
if (options?.cwd) {
|
if (options?.cwd) {
|
||||||
fullCustomInstructions = await addCustomInstructions(
|
fullCustomInstructions = await addCustomInstructions(
|
||||||
|
app,
|
||||||
baseCustomInstructions,
|
baseCustomInstructions,
|
||||||
options.globalCustomInstructions || "",
|
options.globalCustomInstructions || "",
|
||||||
options.cwd,
|
options.cwd,
|
||||||
|
|||||||
@ -252,7 +252,7 @@ export class PromptGenerator {
|
|||||||
|
|
||||||
// Add current mode details
|
// Add current mode details
|
||||||
const currentMode = this.settings.mode
|
const currentMode = this.settings.mode
|
||||||
const modeDetails = await getFullModeDetails(currentMode)
|
const modeDetails = await getFullModeDetails(this.app, currentMode, this.customModeList, this.customModePrompts)
|
||||||
details += `\n\n# Current Mode\n`
|
details += `\n\n# Current Mode\n`
|
||||||
details += `<slug>${currentMode}</slug>\n`
|
details += `<slug>${currentMode}</slug>\n`
|
||||||
details += `<name>${modeDetails.name}</name>\n`
|
details += `<name>${modeDetails.name}</name>\n`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user