diff --git a/README.md b/README.md index fc4afb5..44a65f0 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,27 @@ [![devopsgpt demo](devopsgpt.jpg)](https://youtu.be/IPXmjUcDZJU?si=4S5U_y8Jr1u5gOrh) -# DevOps-GPT +# 🚀 DevOpsGPT: Automate Your DevOps Workflow -This project helps you to balance your daily work as a DevOps engineer, from simple bug fixes to project template generation. you don't need to search on Google for some routine jobs and it helps you with a robust prompt to simplify your career. +DevOpsGPT is a revolutionary tool designed to streamline your workflow and empower you to build systems and automate tasks with ease. -## Run DevOpsGPT +**Tired of spending hours on repetitive DevOps tasks?** -Builds and starts the Docker Compose stack: - - make - -Stops and removes the Docker Compose stack: +DevOpsGPT is here to help! Whether you're setting up infrastructure, speeding up deployments, or tackling any other DevOps challenge, our app can make your life easier and more productive. - make down +**Here's what you can expect with DevOpsGPT:** - Installs the Helm chart for the devopsgpt app on a Kubernetes cluster: +* **Faster task completion:** Automate repetitive tasks and free up your time to focus on more strategic initiatives. +* **Simplified workflows:** Our intuitive interface makes it easy to get started and use DevOpsGPT to its full potential. +* **Increased efficiency:** Streamline your DevOps processes and achieve more with less effort. - make helm-install - -Uninstalls the Helm chart for the devopsgpt app: - - make helm-uninstall - -You can override the release name and namespace for Helm commands by running: - - make [helm-install|helm-uninstall] namespace=NAMESPACE releaseName=RELEASENAME - -The default namespace is `default` and the default release name is `devopsgpt`. - - - -## Running Tests - -To run tests, run the following command - -``` -cd app && pytest tests/ -``` - - - - -## Environment Variables - -To run this project, you will need to add the following environment variables to your .env file - -`KEY` (OpenAI API Key) +**Ready to experience the DevOpsGPT difference?** +1. Visit our website: https://hobs.ai +2. Sign in or create an account. +3. Start exploring the many features of DevOpsGPT and see how it can transform your workflow. +4. We value your feedback! Share your thoughts and suggestions with us to help us continuously improve DevOpsGPT. +**We're confident that DevOpsGPT will become an essential tool in your DevOps toolkit. Let's work together to make it even better!** ## API Reference diff --git a/app/gpt_services.py b/app/gpt_services.py index bb30832..dcc69d9 100644 --- a/app/gpt_services.py +++ b/app/gpt_services.py @@ -2,10 +2,10 @@ from openai import OpenAI from fastapi import HTTPException -def gpt_service(prompt): +def gpt_service(prompt,token): try: - client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY")) + client = OpenAI(api_key=token) chat_completion = client.chat.completions.create( messages=[ { diff --git a/app/models/terraform_models.py b/app/models/terraform_models.py index 82c2fa0..eed3a87 100644 --- a/app/models/terraform_models.py +++ b/app/models/terraform_models.py @@ -5,7 +5,7 @@ class IaCBasicInput(BasicInput): input:str - service:Optional[str] = 'terraform' + token:str @validator("input") def validate_input(cls, value): @@ -13,17 +13,11 @@ def validate_input(cls, value): raise ValueError("Input cannot be empty.") return value - @validator("service") - def validate_service(cls, value): - allowed_services = ['terraform'] - if value not in allowed_services: - raise ValueError(f"Service must be one of {allowed_services}.") - return value + class IaCBugfixInput(BasicInput): bug_description:str - version:str = 'latest' - service:Optional[str] = 'terraform' + token:str @validator("bug_description") def validate_bug_description(cls, value): @@ -31,18 +25,7 @@ def validate_bug_description(cls, value): raise ValueError("Bug description cannot be empty.") return value - @validator("version") - def validate_version(cls, value): - if not value: - raise ValueError("Version cannot be empty.") - return value - - @validator("service") - def validate_service(cls, value): - allowed_services = ['terraform'] - if value not in allowed_services: - raise ValueError(f"Service must be one of {allowed_services}.") - return value + class IaCInstallationInput(BaseModel): os:str = "Ubuntu" diff --git a/app/prompt_generators.py b/app/prompt_generators.py index 34eaf6d..ae7d718 100644 --- a/app/prompt_generators.py +++ b/app/prompt_generators.py @@ -5,10 +5,7 @@ def IaC_basics_generator(input : IaCBasicInput) -> str: prompt = f""" - Write a robust answer about {input.service}, - focusing on the latest update of {input.service} and based on this question:{input.input}, - minimun length of answer is {input.min_tokens} and maximum length is {input.max_tokens} - + {input.input} """ return prompt @@ -16,10 +13,7 @@ def IaC_basics_generator(input : IaCBasicInput) -> str: def IaC_bugfix_generator(input : IaCBugfixInput) -> str: prompt = f""" - Write a clear answer to debug {input.service} - focusing on the version {input.version} of {input.service} and based on this bug:{input.bug_description}, - generate a correct code that help us to solve this bug. - minimum length of answer is {input.min_tokens} and maximum length is {input.max_tokens} + {input.bug_description} """ return prompt diff --git a/app/routes/terraform.py b/app/routes/terraform.py index 6894ebf..34ea5c6 100644 --- a/app/routes/terraform.py +++ b/app/routes/terraform.py @@ -38,7 +38,7 @@ async def IaC_basic_generation(request:IaCBasicInput) -> Output: if os.environ.get("TEST"): return Output(output='Terraform developed by hashicorp and it is very usefull') generated_prompt = IaC_basics_generator(request) - output = gpt_service(generated_prompt) + output = gpt_service(generated_prompt,request.token) return Output(output=output) @app.post("/api/IaC-bugfix/") @@ -46,7 +46,7 @@ async def IaC_bugfix_generation(request:IaCBugfixInput) -> Output: if os.environ.get("TEST"): return Output(output='fix this bug by adding x to the y') generated_prompt = IaC_bugfix_generator(request) - output = gpt_service(generated_prompt) + output = gpt_service(generated_prompt,request.token) return Output(output=output)