diff --git a/apps/copilot/app.py b/apps/copilot/app.py index b7953641..5d629435 100644 --- a/apps/copilot/app.py +++ b/apps/copilot/app.py @@ -51,6 +51,7 @@ def health(): def chat(): try: request_data = ApiRequest(**request.json) + print(f"received /chat request: {request_data}") validate_request(request_data) response = get_response( @@ -61,7 +62,7 @@ def chat(): copilot_instructions=copilot_instructions ) api_response = ApiResponse(response=response).model_dump() - + print(f"sending /chat response: {api_response}") return jsonify(api_response) except ValidationError as ve: @@ -88,6 +89,7 @@ def chat(): def edit_agent_instructions(): try: request_data = ApiRequest(**request.json) + print(f"received /edit_agent_instructions request: {request_data}") validate_request(request_data) response = get_response( @@ -99,6 +101,7 @@ def edit_agent_instructions(): ) api_response = ApiResponse(response=response).model_dump() + print(f"sending /edit_agent_instructions response: {api_response}") return jsonify(api_response) except ValidationError as ve: diff --git a/apps/copilot/copilot.py b/apps/copilot/copilot.py index 2266cfe8..8343ddd6 100644 --- a/apps/copilot/copilot.py +++ b/apps/copilot/copilot.py @@ -540,7 +540,6 @@ User: {last_message.content} updated_msgs = [{"role": "system", "content": sys_prompt}] + [ message.model_dump() for message in messages ] - print(json.dumps(updated_msgs, indent=2)) response = openai_client.chat.completions.create( model=MODEL_NAME, diff --git a/apps/rowboat/app/actions/copilot_actions.ts b/apps/rowboat/app/actions/copilot_actions.ts index d677d599..dcb8a68c 100644 --- a/apps/rowboat/app/actions/copilot_actions.ts +++ b/apps/rowboat/app/actions/copilot_actions.ts @@ -36,7 +36,7 @@ export async function getCopilotResponse( current_workflow_config: JSON.stringify(convertToCopilotWorkflow(current_workflow_config)), context: context ? convertToCopilotApiChatContext(context) : null, }; - console.log(`copilot request`, JSON.stringify(request, null, 2)); + console.log(`sending copilot request`, JSON.stringify(request)); // call copilot api const response = await fetch(process.env.COPILOT_API_URL + '/chat', { @@ -54,7 +54,7 @@ export async function getCopilotResponse( // parse and return response const json: z.infer = await response.json(); - console.log(`copilot response`, JSON.stringify(json, null, 2)); + console.log(`received copilot response`, JSON.stringify(json)); if ('error' in json) { throw new Error(`Failed to call copilot api: ${json.error}`); } @@ -182,7 +182,7 @@ export async function getCopilotAgentInstructions( agentName: agentName, } }; - console.log(`copilot request`, JSON.stringify(request, null, 2)); + console.log(`sending copilot agent instructions request`, JSON.stringify(request)); // call copilot api const response = await fetch(process.env.COPILOT_API_URL + '/edit_agent_instructions', { @@ -201,7 +201,7 @@ export async function getCopilotAgentInstructions( // parse and return response const json = await response.json(); - console.log(`copilot response`, JSON.stringify(json, null, 2)); + console.log(`received copilot agent instructions response`, JSON.stringify(json)); let copilotResponse: z.infer; let agent_instructions: string; try { diff --git a/apps/rowboat/app/lib/utils.ts b/apps/rowboat/app/lib/utils.ts index 2e395ca3..8a0b522e 100644 --- a/apps/rowboat/app/lib/utils.ts +++ b/apps/rowboat/app/lib/utils.ts @@ -140,7 +140,7 @@ export async function getAgenticApiResponse( rawAPIResponse: unknown, }> { // call agentic api - console.log(`agentic request`, JSON.stringify(request, null, 2)); + console.log(`sending agentic api request`, JSON.stringify(request)); const response = await fetch(process.env.AGENTS_API_URL + '/chat', { method: 'POST', body: JSON.stringify(request), @@ -154,6 +154,7 @@ export async function getAgenticApiResponse( throw new Error(`Failed to call agentic api: ${response.statusText}`); } const responseJson = await response.json(); + console.log(`received agentic api response`, JSON.stringify(responseJson)); const result: z.infer = responseJson; return { messages: result.messages,