mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Refactor OTEL logging for API calls (#991)
Refactor OpenTelemetry logging for API requests, responses, and errors. Moved logging responsibility from GeminiClient to GeminiChat for more detailed logging. #750
This commit is contained in:
15
packages/core/src/utils/requestUtils.ts
Normal file
15
packages/core/src/utils/requestUtils.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Content } from '@google/genai';
|
||||
|
||||
export function getRequestTextFromContents(contents: Content[]): string {
|
||||
return contents
|
||||
.flatMap((content) => content.parts ?? [])
|
||||
.map((part) => part.text)
|
||||
.filter(Boolean)
|
||||
.join('');
|
||||
}
|
||||
Reference in New Issue
Block a user