MCPcopy Index your code
hub / github.com/AI45Lab/Code / session_request_parts

Function session_request_parts

sdk/node/src/lib.rs:817–843  ·  view source on GitHub ↗
(
    request: Either<String, SessionRequestOptions>,
    history: Option<Vec<MessageObject>>,
)

Source from the content-addressed store, hash-verified

815}
816
817fn session_request_parts(
818 request: Either<String, SessionRequestOptions>,
819 history: Option<Vec<MessageObject>>,
820) -> napi::Result<(
821 String,
822 Option<Vec<RustMessage>>,
823 Vec<a3s_code_core::llm::Attachment>,
824)> {
825 match request {
826 Either::A(prompt) => {
827 let rust_history = history.map(|h| js_messages_to_rust(&h)).transpose()?;
828 Ok((prompt, rust_history, Vec::new()))
829 }
830 Either::B(request) => {
831 let rust_history = request
832 .history
833 .map(|h| js_messages_to_rust(&h))
834 .transpose()?;
835 let rust_attachments = request
836 .attachments
837 .as_deref()
838 .map(js_attachments_to_rust)
839 .unwrap_or_default();
840 Ok((request.prompt, rust_history, rust_attachments))
841 }
842 }
843}
844
845async fn send_session_request(
846 session: Arc<RustAgentSession>,

Callers 5

sendMethod · 0.85
runMethod · 0.85
streamMethod · 0.85
send_requestMethod · 0.85
stream_requestMethod · 0.85

Calls 1

js_messages_to_rustFunction · 0.85

Tested by

no test coverage detected