AI Agent Service Toolkit
AI Agent Service Toolkit
https://github.com/fanqingsong/agent-service-toolkit
A full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit.
It includes a LangGraph agent, a FastAPI service to serve it, a client to interact with the service, and a Streamlit app that uses the client to provide a chat interface. Data structures and settings are built with Pydantic.
This project offers a template for you to easily build and run your own agents using the LangGraph framework. It demonstrates a complete setup from agent definition to user interface, making it easier to get started with LangGraph-based projects by providing a full, robust toolkit.
https://agent-service-toolkit.streamlit.app/
- LangGraph Agent and latest features: A customizable agent built using the LangGraph framework. Implements the latest LangGraph v0.3 features including human in the loop with
interrupt()
, and flow control withCommand
, andlanggraph-supervisor
. - FastAPI Service: Serves the agent with both streaming and non-streaming endpoints.
- Advanced Streaming: A novel approach to support both token-based and message-based streaming.
- Streamlit Interface: Provides a user-friendly chat interface for interacting with the agent.
- Multiple Agent Support: Run multiple agents in the service and call by URL path. Available agents and models are described in
/info
- Asynchronous Design: Utilizes async/await for efficient handling of concurrent requests.
- Content Moderation: Implements LlamaGuard for content moderation (requires Groq API key).
- Feedback Mechanism: Includes a star-based feedback system integrated with LangSmith.
- Docker Support: Includes Dockerfiles and a docker compose file for easy development and deployment.
- Testing: Includes robust unit and integration tests for the full repo.
The repository is structured as follows:
src/agents/
: Defines several agents with different capabilitiessrc/schema/
: Defines the protocol schemasrc/core/
: Core modules including LLM definition and settingssrc/service/service.py
: FastAPI service to serve the agentssrc/client/client.py
: Client to interact with the agent servicesrc/streamlit_app.py
: Streamlit app providing a chat interfacetests/
: Unit and integration tests
出处:http://www.cnblogs.com/lightsong/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。