mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
doc: basic docs and rename types (#471)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::transport::{ReadStream, WriteStream};
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use mcp_core::types::*;
|
||||
use mcp_core::protocol::*;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde_json::{json, Value};
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::transport::{ReadStream, Transport, WriteStream};
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use futures_util::StreamExt;
|
||||
use mcp_core::types::JsonRpcMessage;
|
||||
use mcp_core::protocol::JsonRpcMessage;
|
||||
use reqwest::{Client, Url};
|
||||
use reqwest_eventsource::{Event, EventSource};
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::transport::{ReadStream, Transport, WriteStream};
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use mcp_core::types::*;
|
||||
use mcp_core::protocol::*;
|
||||
use std::process::Stdio;
|
||||
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
|
||||
use tokio::process::{Child, Command};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use mcp_core::types::JsonRpcMessage;
|
||||
use mcp_core::protocol::JsonRpcMessage;
|
||||
use tokio::sync::mpsc::{Receiver, Sender};
|
||||
|
||||
// Stream types for consistent interface
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/// Content sent around agents, systems, and LLMs
|
||||
/// The various content types can be display to humans but also understood by models
|
||||
/// They include optional annotations used to help inform agent usage
|
||||
use super::role::Role;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -48,7 +51,6 @@ pub struct ImageContent {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type", rename_all = "camelCase")]
|
||||
/// Content passed to or from an LLM
|
||||
pub enum Content {
|
||||
Text(TextContent),
|
||||
Image(ImageContent),
|
||||
|
||||
@@ -7,5 +7,4 @@ pub mod tool;
|
||||
pub use tool::{Tool, ToolCall};
|
||||
pub mod resource;
|
||||
pub use resource::{Resource, ResourceContents};
|
||||
pub mod types;
|
||||
pub use types::*;
|
||||
pub mod protocol;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// The protocol messages exchanged between client and server
|
||||
use crate::{content::Content, resource::Resource, resource::ResourceContents, tool::Tool};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
@@ -1,3 +1,4 @@
|
||||
/// Resources that servers provide to clients
|
||||
use anyhow::{anyhow, Result};
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// Roles to describe the origin/ownership of content
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// Tools represent a routine that a server can execute
|
||||
/// Tool calls represent requests from the client to execute one
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user