mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
AIX: Debugger: rename Dispatch Request loopback
This commit is contained in:
@@ -551,8 +551,8 @@ async function _aixChatGenerateContent_LL(
|
||||
fragments: [],
|
||||
/* rest start as undefined (missing in reality) */
|
||||
};
|
||||
const debugDispatchRequestbody = getLabsDevMode() && aixContext.name === 'conversation'; // [DEV] Debugging the conversation request (only)
|
||||
const contentReassembler = new ContentReassembler(accumulator_LL, debugDispatchRequestbody);
|
||||
const debugDispatchRequest = getLabsDevMode() && aixContext.name === 'conversation'; // [DEV] Debugging the conversation request (only)
|
||||
const contentReassembler = new ContentReassembler(accumulator_LL, debugDispatchRequest);
|
||||
|
||||
// Initialize throttler if throttling is enabled
|
||||
const throttler = (onReassemblyUpdate && throttleParallelThreads)
|
||||
@@ -568,9 +568,9 @@ async function _aixChatGenerateContent_LL(
|
||||
chatGenerate: aixChatGenerate,
|
||||
context: aixContext,
|
||||
streaming: getLabsDevNoStreaming() ? false : aixStreaming, // [DEV] disable streaming if set in the UX (testing)
|
||||
...(debugDispatchRequestbody && {
|
||||
...(debugDispatchRequest && {
|
||||
connectionOptions: {
|
||||
debugDispatchRequestbody: true, // [DEV] Debugging the request without requiring a server restart
|
||||
debugDispatchRequest: true, // [DEV] Debugging the request without requiring a server restart
|
||||
},
|
||||
}),
|
||||
}, {
|
||||
|
||||
@@ -54,7 +54,7 @@ export const aixRouter = createTRPCRouter({
|
||||
try {
|
||||
|
||||
// [DEV] Debugging the request without requiring a server restart
|
||||
if (input.connectionOptions?.debugDispatchRequestbody) {
|
||||
if (input.connectionOptions?.debugDispatchRequest) {
|
||||
chatGenerateTx.addDebugRequestInDev(dispatch.request.url, dispatch.request.headers, dispatch.request.body);
|
||||
yield* chatGenerateTx.emitParticles();
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ export namespace AixWire_API {
|
||||
/// Connection options
|
||||
|
||||
export const ConnectionOptions_schema = z.object({
|
||||
debugDispatchRequestbody: z.boolean().optional(),
|
||||
debugDispatchRequest: z.boolean().optional(),
|
||||
throttlePartTransmitter: z.number().optional(), // in ms
|
||||
// retry: z.number().optional(),
|
||||
// retryDelay: z.number().optional(),
|
||||
@@ -502,7 +502,7 @@ export namespace AixWire_Particles {
|
||||
| { cg: 'issue', issueId: CGIssueId, issueText: string }
|
||||
| { cg: 'set-metrics', metrics: CGSelectMetrics }
|
||||
| { cg: 'set-model', name: string }
|
||||
| { cg: '_debugRequest', security: 'dev-env', request: { url: string, headers: string, body: string } }; // may generalize this in the future
|
||||
| { cg: '_debugDispatchRequest', security: 'dev-env', dispatchRequest: { url: string, headers: string, body: string } }; // may generalize this in the future
|
||||
|
||||
export type CGEndReason = // the reason for the end of the chat generation
|
||||
| 'abort-client' // user aborted before the end of stream
|
||||
|
||||
@@ -130,9 +130,9 @@ export class ChatGenerateTransmitter implements IParticleTransmitter {
|
||||
// [security] only emit in development, as it may contain sensitive information
|
||||
if (process.env.NODE_ENV !== 'development') return;
|
||||
this.transmissionQueue.push({
|
||||
cg: '_debugRequest',
|
||||
cg: '_debugDispatchRequest',
|
||||
security: 'dev-env',
|
||||
request: {
|
||||
dispatchRequest: {
|
||||
url,
|
||||
headers: JSON.stringify(headers, null, 2),
|
||||
body: JSON.stringify(body, null, 2),
|
||||
|
||||
Reference in New Issue
Block a user