From 2af47e476aa580aef9211473300db8baba881c3a Mon Sep 17 00:00:00 2001 From: geoffsee <> Date: Tue, 27 May 2025 15:18:11 -0400 Subject: [PATCH] update docs --- README.md | 14 +++++++------- docs/agents.md | 15 +++++++-------- docs/api.md | 5 ++--- docs/index.md | 4 ++-- docs/input.md | 13 ------------- 5 files changed, 18 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 5758454..677d6d4 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ use tracing; use crate::utils::utils::run_agent; -pub async fn your_agent_name(stream_id: &str, input: &str) -> Result { +pub async fn agent(stream_id: &str, input: &str) -> Result { run_agent(stream_id, input, "./packages/genaiscript/genaisrc/your-agent.genai.mts").await } ``` @@ -82,20 +82,20 @@ pub async fn your_agent_name(stream_id: &str, input: &str) -> Result search_agent(stream_id.as_str(), &*input).await, - "news-search" => news_agent(stream_id.as_str(), &*input).await, + "web-search" => crate::agents::search::agent(agent_id.as_str(), &*input).await, + "news-search" => crate::agents::news::agent(agent_id.as_str(), &*input).await, // Add your agent here - "your-resource-name" => your_agent_name(stream_id.as_str(), &*input).await, + "your-resource-name" => crate::agents::your_module::agent(agent_id.as_str(), &*input).await, _ => { tracing::error!("Unsupported resource type: {}", resource); return StatusCode::BAD_REQUEST.into_response(); diff --git a/docs/agents.md b/docs/agents.md index dfe7ece..df6bce6 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -13,7 +13,6 @@ The following agents are currently available: | Web Search | Performs web searches using SearxNG | `web-search` | | News Search | Searches for news articles | `news-search` | | Image Generator | Generates images based on text prompts | `image-generator` | -| Finance Query | Provides financial information | `finance-query` | | Web Scrape | Scrapes content from web pages | `web-scrape` | ## Creating a New Agent @@ -55,7 +54,7 @@ use tracing; use crate::utils::utils::run_agent; -pub async fn your_agent_name(stream_id: &str, input: &str) -> Result { +pub async fn agent(stream_id: &str, input: &str) -> Result { run_agent(stream_id, input, "./packages/genaiscript/genaisrc/your-agent.genai.mts").await } ``` @@ -65,20 +64,20 @@ pub async fn your_agent_name(stream_id: &str, input: &str) -> Result search_agent(stream_id.as_str(), &*input).await, - "news-search" => news_agent(stream_id.as_str(), &*input).await, + "web-search" => crate::agents::search::agent(agent_id.as_str(), &*input).await, + "news-search" => crate::agents::news::agent(agent_id.as_str(), &*input).await, // Add your agent here - "your-resource-name" => your_agent_name(stream_id.as_str(), &*input).await, + "your-resource-name" => crate::agents::your_module::agent(agent_id.as_str(), &*input).await, _ => { tracing::error!("Unsupported resource type: {}", resource); return StatusCode::BAD_REQUEST.into_response(); diff --git a/docs/api.md b/docs/api.md index be7ed95..8325a36 100644 --- a/docs/api.md +++ b/docs/api.md @@ -44,7 +44,7 @@ Creates a new stream resource for an agent. | Field | Type | Description | |-------|------|-------------| -| `resource` | string | The type of agent to use (e.g., "web-search", "news-search", "image-generator", "finance-query", "web-scrape") | +| `resource` | string | The type of agent to use (e.g., "web-search", "news-search", "image-generator", "web-scrape") | | `input` | string | The input query or prompt for the agent | **Response:** @@ -81,7 +81,6 @@ The following agent types are available for use with the `resource` field in the | `web-search` | Performs web searches using SearxNG | | `news-search` | Searches for news articles | | `image-generator` | Generates images based on text prompts | -| `finance-query` | Provides financial information | | `web-scrape` | Scrapes content from web pages | ## Error Responses @@ -109,4 +108,4 @@ curl -X POST https://your-server.com/api/webhooks \ ```bash curl https://your-server.com/webhooks/abc123 \ -H "Authorization: Bearer " -``` \ No newline at end of file +``` diff --git a/docs/index.md b/docs/index.md index b7d7fc1..b8a00c8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ Welcome to the documentation for web-agent-rs, a GenAIScript host for integratio ## Overview -web-agent-rs is a server that hosts GenAIScript agents for integration into conversational AI applications. It provides a simple API for creating and consuming stream resources that execute various agents to perform tasks like web search, news search, image generation, finance queries, and web scraping. +web-agent-rs is a server that hosts GenAIScript agents for integration into conversational AI applications. It provides a simple API for creating and consuming stream resources that execute various agents to perform tasks like web search, news search, image generation, and web scraping. ## Architecture @@ -42,4 +42,4 @@ Please note that this project has not undergone a formal security assessment. Yo ## Contributing -Contributions to web-agent-rs are welcome! Please feel free to submit issues and pull requests to improve the project. \ No newline at end of file +Contributions to web-agent-rs are welcome! Please feel free to submit issues and pull requests to improve the project. diff --git a/docs/input.md b/docs/input.md index c7243f7..85b06f8 100644 --- a/docs/input.md +++ b/docs/input.md @@ -128,23 +128,10 @@ genaiscript run packages/genaiscript/genaisrc/web-scrape.genai.mts --vars USER_I genaiscript run packages/genaiscript/genaisrc/web-scrape.genai.mts --vars USER_INPUT='{"url":"https://www.time4learning.com/homeschool-curriculum/high-school/eleventh-grade/math.html","query":"What is on this page?", "action": "scrape"}' ``` -#### Finance Query Agent - -```bash -# Crypto quote -genaiscript run packages/genaiscript/genaisrc/finance-query.genai.mts --vars USER_INPUT='Get a quote for BTC' - -# Crypto news -genaiscript run packages/genaiscript/genaisrc/finance-query.genai.mts --vars USER_INPUT='What is the news for Bitcoin?' - -# Market overview -genaiscript run packages/genaiscript/genaisrc/finance-query.genai.mts --vars USER_INPUT='What are the trending symbols in the market?' -``` Note the different input formats: - Simple text queries for search and news agents - JSON objects for the web scrape agent, specifying URL, query, and action -- Specific command-like queries for the finance agent ## Related Documentation