mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Request sanitization now includes an extra proxy-specific preprocessing step for safer AI proxying. * **New Features** * Initialization prompts centralized into a shared helper, with a web-specific prompt variant. * Authenticated requests can optionally route via a provided external API key to access alternate models. * **Chores** * Added and exposed a preprocessing hook with a default no-op implementation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
9 lines
325 B
TypeScript
9 lines
325 B
TypeScript
/**
|
|
* Opaque preprocessing step applied to every parsed request body that
|
|
* flows through the AI proxy. The concrete behavior lives in the
|
|
* private implementation; the fallback is an identity function.
|
|
*/
|
|
export type AiProxyBodyProcessor = (input: {
|
|
parsedBody: Record<string, unknown>,
|
|
}) => Record<string, unknown>;
|