CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
argumentProcessor.ts28 linesDownload Raw Back to prompt-processors
1/**2 * @license3 * Copyright 2025 Google LLC4 * SPDX-License-Identifier: Apache-2.05 */6 7import { appendToLastTextPart } from '@qwen-code/qwen-code-core';8import type { IPromptProcessor, PromptPipelineContent } from './types.js';9import type { CommandContext } from '../../ui/commands/types.js';10 11/**12 * Appends the user's full command invocation to the prompt if arguments are13 * provided, allowing the model to perform its own argument parsing.14 *15 * This processor is only used if the prompt does NOT contain {{args}}.16 */17export class DefaultArgumentProcessor implements IPromptProcessor {18  async process(19    prompt: PromptPipelineContent,20    context: CommandContext,21  ): Promise<PromptPipelineContent> {22    if (context.invocation?.args) {23      return appendToLastTextPart(prompt, context.invocation.raw);24    }25    return prompt;26  }27}28 
basant307/AI_Governance_Project · CoolFace