From 71a2e402bf94353cc2a937a3b2158a11979a8b63 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 21:43:31 +0000 Subject: [PATCH 1/2] Add CodegenServiceDocsTool for service information --- src/codegen/extensions/service_docs.py | 81 ++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/codegen/extensions/service_docs.py diff --git a/src/codegen/extensions/service_docs.py b/src/codegen/extensions/service_docs.py new file mode 100644 index 000000000..a9cffa50d --- /dev/null +++ b/src/codegen/extensions/service_docs.py @@ -0,0 +1,81 @@ +""" +Codegen Service Documentation Tool + +This module provides information about how the Codegen service works, +including how to add repositories, connect to Linear, pricing, and more. +""" + +from typing import Dict, Any + + +def codegen_service_docs(query: str = None) -> Dict[str, Any]: + """ + Returns information about how the Codegen service works. + + Args: + query: Optional query to filter the information returned. + + Returns: + A dictionary containing information about the Codegen service. + """ + # This is a placeholder. The actual content will be filled in by the user. + service_docs = { + "description": "Codegen is an AI-powered software engineering assistant that helps developers with code analysis, refactoring, and development tasks.", + "repositories": { + "adding_repos": "To add an extra repository to Codegen, please contact the Codegen team with the repository details.", + "supported_platforms": ["GitHub", "GitLab", "Bitbucket"], + }, + "integrations": { + "linear": { + "setup": "To connect Codegen to Linear, you need to configure the Linear API token in your Codegen settings.", + "capabilities": ["View issues", "Create issues", "Comment on issues", "Update issue status"], + }, + "slack": { + "setup": "Codegen integrates with Slack through the Slack App Directory. Install the Codegen app to your workspace.", + "capabilities": ["Respond to messages", "Create threads", "Share code snippets"], + }, + "github": { + "setup": "Codegen connects to GitHub repositories through GitHub Apps. Install the Codegen GitHub App to your organization.", + "capabilities": ["View code", "Create PRs", "Review PRs", "Comment on issues"], + }, + }, + "pricing": { + "plans": [ + {"name": "Free", "description": "Limited access to Codegen features"}, + {"name": "Pro", "description": "Full access to Codegen features for individual developers"}, + {"name": "Team", "description": "Codegen for teams with collaboration features"}, + {"name": "Enterprise", "description": "Custom Codegen deployment with advanced security and support"}, + ], + "contact": "For pricing details, please contact sales@codegen.sh", + }, + "support": { + "documentation": "https://docs.codegen.sh", + "contact": "support@codegen.sh", + }, + } + + # If a query is provided, try to find the relevant information + if query: + query = query.lower() + + # Handle common queries + if "repo" in query or "repository" in query or "add" in query: + return {"repositories": service_docs["repositories"]} + + if "linear" in query or "connect" in query: + return {"linear": service_docs["integrations"]["linear"]} + + if "cost" in query or "price" in query or "pricing" in query: + return {"pricing": service_docs["pricing"]} + + if "slack" in query: + return {"slack": service_docs["integrations"]["slack"]} + + if "github" in query: + return {"github": service_docs["integrations"]["github"]} + + if "support" in query or "help" in query: + return {"support": service_docs["support"]} + + # Return all information if no query or no match + return service_docs \ No newline at end of file From 37658cc89f712b53911b3f26ba0799c87d8b5af5 Mon Sep 17 00:00:00 2001 From: "codegen-sh[bot]" <131295404+codegen-sh[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 21:44:24 +0000 Subject: [PATCH 2/2] Automated pre-commit update --- src/codegen/extensions/service_docs.py | 32 ++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/codegen/extensions/service_docs.py b/src/codegen/extensions/service_docs.py index a9cffa50d..e271b15ca 100644 --- a/src/codegen/extensions/service_docs.py +++ b/src/codegen/extensions/service_docs.py @@ -1,20 +1,18 @@ -""" -Codegen Service Documentation Tool +"""Codegen Service Documentation Tool This module provides information about how the Codegen service works, including how to add repositories, connect to Linear, pricing, and more. """ -from typing import Dict, Any +from typing import Any, Optional -def codegen_service_docs(query: str = None) -> Dict[str, Any]: - """ - Returns information about how the Codegen service works. - +def codegen_service_docs(query: Optional[str] = None) -> dict[str, Any]: + """Returns information about how the Codegen service works. + Args: query: Optional query to filter the information returned. - + Returns: A dictionary containing information about the Codegen service. """ @@ -53,29 +51,29 @@ def codegen_service_docs(query: str = None) -> Dict[str, Any]: "contact": "support@codegen.sh", }, } - + # If a query is provided, try to find the relevant information if query: query = query.lower() - + # Handle common queries if "repo" in query or "repository" in query or "add" in query: return {"repositories": service_docs["repositories"]} - + if "linear" in query or "connect" in query: return {"linear": service_docs["integrations"]["linear"]} - + if "cost" in query or "price" in query or "pricing" in query: return {"pricing": service_docs["pricing"]} - + if "slack" in query: return {"slack": service_docs["integrations"]["slack"]} - + if "github" in query: return {"github": service_docs["integrations"]["github"]} - + if "support" in query or "help" in query: return {"support": service_docs["support"]} - + # Return all information if no query or no match - return service_docs \ No newline at end of file + return service_docs