Verbose message logging only when debug = true
This commit is contained in:
@@ -250,6 +250,7 @@ app.post('/v1/messages', async (req, res) => {
|
||||
console.log(`[API] Request for model: ${request.model}, stream: ${!!stream}`);
|
||||
|
||||
// Debug: Log message structure to diagnose tool_use/tool_result ordering
|
||||
if (process.env.DEBUG) {
|
||||
console.log('[API] Message structure:');
|
||||
messages.forEach((msg, i) => {
|
||||
const contentTypes = Array.isArray(msg.content)
|
||||
@@ -257,6 +258,7 @@ app.post('/v1/messages', async (req, res) => {
|
||||
: (typeof msg.content === 'string' ? 'text' : 'unknown');
|
||||
console.log(` [${i}] ${msg.role}: ${contentTypes}`);
|
||||
});
|
||||
}
|
||||
|
||||
if (stream) {
|
||||
// Handle streaming response
|
||||
|
||||
Reference in New Issue
Block a user