feat: provide more context information (#236)
* feat: provide more context information 1. provide context for notification 2. allow extract more info from tool call 3. inject http request part for streamable http server * docs: add document for getting peer from context
This commit is contained in:
parent
9fc6af091d
commit
969fad26cc
1 changed files with 194 additions and 40 deletions
|
|
@ -210,7 +210,12 @@ where
|
|||
Some(ClientJsonRpcMessage::notification(notification)),
|
||||
));
|
||||
};
|
||||
let _ = service.handle_notification(notification).await;
|
||||
let context = NotificationContext {
|
||||
meta: notification.get_meta().clone(),
|
||||
extensions: notification.extensions().clone(),
|
||||
peer: peer.clone(),
|
||||
};
|
||||
let _ = service.handle_notification(notification, context).await;
|
||||
// Continue processing service
|
||||
Ok(serve_inner(service, transport, peer, peer_rx, ct))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue