MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / llm_call_end

Function llm_call_end

crates/python/src/py_api/mod.rs:639–666  ·  view source on GitHub ↗
(
    handle: &PyLLMHandle,
    response: &Bound<'_, PyAny>,
    data: Option<&Bound<'_, PyAny>>,
    metadata: Option<&Bound<'_, PyAny>>,
    annotated_response: Option<&Bound<'_, PyAny>>,
    respon

Source from the content-addressed store, hash-verified

637 timestamp: "datetime.datetime | None"=None
638) -> "None", text_signature = "(handle: LlmHandle, response: object, *, data: object | None = None, metadata: object | None = None, annotated_response: AnnotatedLLMResponse | object | None = None, response_codec: object | None = None, timestamp: datetime.datetime | None = None) -> None")]
639fn llm_call_end(
640 handle: &PyLLMHandle,
641 response: &Bound<'_, PyAny>,
642 data: Option<&Bound<'_, PyAny>>,
643 metadata: Option<&Bound<'_, PyAny>>,
644 annotated_response: Option<&Bound<'_, PyAny>>,
645 response_codec: Option<&Bound<'_, PyAny>>,
646 timestamp: Option<&Bound<'_, PyAny>>,
647) -> PyResult<()> {
648 let response_json = py_to_json(response)?;
649 let data = opt_py_to_json(data)?;
650 let metadata = opt_py_to_json(metadata)?;
651 let response_codec = py_llm_response_codec(response_codec);
652 let annotated_response = py_annotated_llm_response(annotated_response)?;
653 let timestamp = opt_py_to_timestamp(timestamp)?;
654 core_llm_api::llm_call_end(
655 core_llm_api::LlmCallEndParams::builder()
656 .handle(&handle.inner)
657 .response(response_json)
658 .data_opt(data)
659 .metadata_opt(metadata)
660 .annotated_response_opt(annotated_response)
661 .response_codec_opt(response_codec)
662 .timestamp_opt(timestamp)
663 .build(),
664 )
665 .map_err(to_py_err)
666}
667
668/// Execute an LLM call through the full middleware pipeline.
669///

Calls 6

py_to_jsonFunction · 0.85
opt_py_to_jsonFunction · 0.85
py_llm_response_codecFunction · 0.85
opt_py_to_timestampFunction · 0.85
buildMethod · 0.45