Skip to main content
Glama
documentation_review_crew.py2.04 kB
#!/usr/bin/env python3.10 """ Documentation Review Crew Specialized crew for documentation quality assessment and improvement suggestions. """ import os import sys from crewai import Agent, Task, Crew from crewai_tools import CodeDocsSearchTool, DirectorySearchTool, FileReadTool from langchain_openai import ChatOpenAI from langfuse.callback import CallbackHandler # Initialize Langfuse for observability langfuse_handler = CallbackHandler() # Initialize LLM with Langfuse tracing llm = ChatOpenAI( model="microsoft/wizardlm-2-8x22b:free", base_url="https://openrouter.ai/api/v1", api_key=os.getenv("OPENROUTER_API_KEY"), temperature=0.1, callbacks=[langfuse_handler] ) # Define Tools code_search = CodeDocsSearchTool() dir_search = DirectorySearchTool() file_read = FileReadTool() # Define Documentation Reviewer Agent documentation_reviewer = Agent( role="Documentation Reviewer", goal="Review and suggest improvements for code documentation and comments", backstory="You are a technical writer and documentation specialist who ensures that code is well-documented, with clear docstrings, comments, and README updates.", llm=llm, tools=[code_search, dir_search, file_read], verbose=True ) # Define Documentation Task documentation_task = Task( description="Review documentation quality including docstrings, comments, README files, and API documentation. Suggest additions or improvements.", expected_output="Documentation review report with recommendations for enhancing code documentation and user guides.", agent=documentation_reviewer ) # Create Documentation Review Crew documentation_crew = Crew( agents=[documentation_reviewer], tasks=[documentation_task], verbose=True ) def main(): """Run the documentation review crew.""" print("Starting Documentation Review Crew...") # Run the crew result = documentation_crew.kickoff() print("\n=== Documentation Review Results ===") print(result) if __name__ == "__main__": main()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cbwinslow/opendiscourse_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server