Variable ResponseContentMatcherProviderConst

ResponseContentMatcherProvider: typeof ResponseContentMatcherProvider = ...

Clients can contribute response content matchers to parse the response content.

The default chat user interface will collect all contributed matchers and use them to parse the response into structured content parts (e.g. code blocks, markdown blocks), which are then rendered with a ChatResponsePartRenderer registered for the respective content part type.

Example

bind(ResponseContentMatcherProvider).to(MyResponseContentMatcherProvider);
...
@injectable()
export class MyResponseContentMatcherProvider implements ResponseContentMatcherProvider {
readonly matchers: ResponseContentMatcher[] = [{
start: /^<command>$/m,
end: /^</command>$/m,
contentFactory: (content: string) => {
const command = content.replace(/^<command>\n|</command>$/g, '');
return new MyChatResponseContentImpl(command.trim());
}
}];
}

See

ResponseContentMatcher