|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -import os |
16 | 15 | import time |
17 | 16 | from dataclasses import dataclass |
18 | 17 | from typing import Any |
|
36 | 35 | from typing_extensions import override |
37 | 36 |
|
38 | 37 | from veadk.config import settings |
39 | | -from veadk.consts import DEFAULT_MODEL_AGENT_API_BASE |
40 | 38 | from veadk.tracing.telemetry.exporters.base_exporter import BaseExporter |
41 | 39 | from veadk.utils.logger import get_logger |
42 | 40 |
|
@@ -300,15 +298,19 @@ def record_call_llm( |
300 | 298 | llm_response: Response object with content and usage metadata |
301 | 299 | """ |
302 | 300 | is_streaming = bool( |
303 | | - invocation_context.run_config and invocation_context.run_config.streaming_mode != StreamingMode.NONE) |
304 | | - server_address = getattr(invocation_context.agent, "model_api_base", None) or "unknown" |
| 301 | + invocation_context.run_config |
| 302 | + and invocation_context.run_config.streaming_mode != StreamingMode.NONE |
| 303 | + ) |
| 304 | + server_address = ( |
| 305 | + getattr(invocation_context.agent, "model_api_base", None) or "unknown" |
| 306 | + ) |
305 | 307 | attributes = { |
306 | 308 | "gen_ai_system": "volcengine", |
307 | 309 | "gen_ai_response_model": llm_request.model, |
308 | 310 | "gen_ai_operation_name": "chat", |
309 | 311 | "gen_ai_operation_type": "llm", |
310 | 312 | "stream": is_streaming, |
311 | | - "server_address": server_address, |
| 313 | + "server_address": server_address, |
312 | 314 | } # required by Volcengine APMPlus |
313 | 315 |
|
314 | 316 | if llm_response.usage_metadata: |
|
0 commit comments