Skip to content

Commit

Permalink
fix: Merge pull request #20 from abolfazl8131/refactor
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
abolfazl8131 authored Oct 31, 2024
2 parents b829ba7 + c5ff992 commit b6637d2
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 1 deletion.
Binary file modified app/__pycache__/main.cpython-311.pyc
Binary file not shown.
Binary file modified app/__pycache__/prompt_generators.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
write_bugfix,
write_installation,
edit_directory_generator,execute_pythonfile)
from .models import (IaCBasicInput,
from app.models import (IaCBasicInput,
IaCBugfixInput,
Output,
IaCInstallationInput,IaCTemplateGeneration,HelmTemplateGeneration)
Expand Down
3 changes: 3 additions & 0 deletions app/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .helm_models import *
from .terraform_models import *
from .utils import *
Binary file added app/models/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added app/models/__pycache__/helm_models.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file added app/models/__pycache__/utils.cpython-311.pyc
Binary file not shown.
12 changes: 12 additions & 0 deletions app/models/helm_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pydantic import BaseModel
from typing import List, Optional

class Pod(BaseModel):
name:str
image:str
target_port:int

class HelmTemplateGeneration(BaseModel):
api_version:int = 1
pods:List[Pod]

23 changes: 23 additions & 0 deletions app/models/terraform_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pydantic import BaseModel
from typing import List, Optional

from .utils import BasicInput


class IaCBasicInput(BasicInput):
input:str
service:Optional[str] = 'terraform'

class IaCBugfixInput(BasicInput):
bug_description:str
version:str = 'latest'
service:Optional[str] = 'terraform'

class IaCInstallationInput(BaseModel):
os:str = "ubuntu"
service:Optional[str] = 'terraform'

class IaCTemplateGeneration(BaseModel):
CI_integration:bool = True
base_config:str = 'ec2'
service:str = 'terraform'
11 changes: 11 additions & 0 deletions app/models/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic import BaseModel
from typing import List, Optional

class Output(BaseModel):
output:str

class BasicInput(BaseModel):

max_tokens:int = 500
min_tokens:int = 100
service:str

0 comments on commit b6637d2

Please sign in to comment.