Skip to content

Commit da1e5e0

Browse files
authored
Merge pull request #162 from devopshobbies/dev
Update REAME.md and re-structure of openai input token
2 parents c922dd9 + e2518f0 commit da1e5e0

File tree

5 files changed

+24
-73
lines changed

5 files changed

+24
-73
lines changed

README.md

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,27 @@
11
[![devopsgpt demo](devopsgpt.jpg)](https://youtu.be/IPXmjUcDZJU?si=4S5U_y8Jr1u5gOrh)
22

3-
# DevOps-GPT
3+
# 🚀 DevOpsGPT: Automate Your DevOps Workflow
44

5-
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.
5+
DevOpsGPT is a revolutionary tool designed to streamline your workflow and empower you to build systems and automate tasks with ease.
66

7-
## Run DevOpsGPT
7+
**Tired of spending hours on repetitive DevOps tasks?**
88

9-
Builds and starts the Docker Compose stack:
10-
11-
make
12-
13-
Stops and removes the Docker Compose stack:
9+
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.
1410

15-
make down
11+
**Here's what you can expect with DevOpsGPT:**
1612

17-
Installs the Helm chart for the devopsgpt app on a Kubernetes cluster:
13+
* **Faster task completion:** Automate repetitive tasks and free up your time to focus on more strategic initiatives.
14+
* **Simplified workflows:** Our intuitive interface makes it easy to get started and use DevOpsGPT to its full potential.
15+
* **Increased efficiency:** Streamline your DevOps processes and achieve more with less effort.
1816

19-
make helm-install
20-
21-
Uninstalls the Helm chart for the devopsgpt app:
22-
23-
make helm-uninstall
24-
25-
You can override the release name and namespace for Helm commands by running:
26-
27-
make [helm-install|helm-uninstall] namespace=NAMESPACE releaseName=RELEASENAME
28-
29-
The default namespace is `default` and the default release name is `devopsgpt`.
30-
31-
32-
33-
## Running Tests
34-
35-
To run tests, run the following command
36-
37-
```
38-
cd app && pytest tests/
39-
```
40-
41-
42-
43-
44-
## Environment Variables
45-
46-
To run this project, you will need to add the following environment variables to your .env file
47-
48-
`KEY` (OpenAI API Key)
17+
**Ready to experience the DevOpsGPT difference?**
4918

19+
1. Visit our website: https://hobs.ai
20+
2. Sign in or create an account.
21+
3. Start exploring the many features of DevOpsGPT and see how it can transform your workflow.
22+
4. We value your feedback! Share your thoughts and suggestions with us to help us continuously improve DevOpsGPT.
5023

24+
**We're confident that DevOpsGPT will become an essential tool in your DevOps toolkit. Let's work together to make it even better!**
5125

5226

5327
## API Reference

app/gpt_services.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from openai import OpenAI
33
from fastapi import HTTPException
44

5-
def gpt_service(prompt):
5+
def gpt_service(prompt,token):
66

77
try:
8-
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
8+
client = OpenAI(api_key=token)
99
chat_completion = client.chat.completions.create(
1010
messages=[
1111
{

app/models/terraform_models.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,27 @@
55

66
class IaCBasicInput(BasicInput):
77
input:str
8-
service:Optional[str] = 'terraform'
8+
token:str
99

1010
@validator("input")
1111
def validate_input(cls, value):
1212
if not value:
1313
raise ValueError("Input cannot be empty.")
1414
return value
1515

16-
@validator("service")
17-
def validate_service(cls, value):
18-
allowed_services = ['terraform']
19-
if value not in allowed_services:
20-
raise ValueError(f"Service must be one of {allowed_services}.")
21-
return value
16+
2217

2318
class IaCBugfixInput(BasicInput):
2419
bug_description:str
25-
version:str = 'latest'
26-
service:Optional[str] = 'terraform'
20+
token:str
2721

2822
@validator("bug_description")
2923
def validate_bug_description(cls, value):
3024
if not value:
3125
raise ValueError("Bug description cannot be empty.")
3226
return value
3327

34-
@validator("version")
35-
def validate_version(cls, value):
36-
if not value:
37-
raise ValueError("Version cannot be empty.")
38-
return value
39-
40-
@validator("service")
41-
def validate_service(cls, value):
42-
allowed_services = ['terraform']
43-
if value not in allowed_services:
44-
raise ValueError(f"Service must be one of {allowed_services}.")
45-
return value
28+
4629

4730
class IaCInstallationInput(BaseModel):
4831
os:str = "Ubuntu"

app/prompt_generators.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@
55
def IaC_basics_generator(input : IaCBasicInput) -> str:
66

77
prompt = f"""
8-
Write a robust answer about {input.service},
9-
focusing on the latest update of {input.service} and based on this question:{input.input},
10-
minimun length of answer is {input.min_tokens} and maximum length is {input.max_tokens}
11-
8+
{input.input}
129
"""
1310
return prompt
1411

1512

1613
def IaC_bugfix_generator(input : IaCBugfixInput) -> str:
1714

1815
prompt = f"""
19-
Write a clear answer to debug {input.service}
20-
focusing on the version {input.version} of {input.service} and based on this bug:{input.bug_description},
21-
generate a correct code that help us to solve this bug.
22-
minimum length of answer is {input.min_tokens} and maximum length is {input.max_tokens}
16+
{input.bug_description}
2317
2418
"""
2519
return prompt

app/routes/terraform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ async def IaC_basic_generation(request:IaCBasicInput) -> Output:
3838
if os.environ.get("TEST"):
3939
return Output(output='Terraform developed by hashicorp and it is very usefull')
4040
generated_prompt = IaC_basics_generator(request)
41-
output = gpt_service(generated_prompt)
41+
output = gpt_service(generated_prompt,request.token)
4242
return Output(output=output)
4343

4444
@app.post("/api/IaC-bugfix/")
4545
async def IaC_bugfix_generation(request:IaCBugfixInput) -> Output:
4646
if os.environ.get("TEST"):
4747
return Output(output='fix this bug by adding x to the y')
4848
generated_prompt = IaC_bugfix_generator(request)
49-
output = gpt_service(generated_prompt)
49+
output = gpt_service(generated_prompt,request.token)
5050
return Output(output=output)
5151

5252

0 commit comments

Comments
 (0)