Initial commit

This commit is contained in:
Ayomide
2025-07-10 15:16:16 +01:00
commit 350f21637c
14 changed files with 515 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# backend/copywriter.py
from .vector_store import VectorStore
from .brand_style import BrandStyle
import openai
class Copywriter:
def __init__(self):
self.vector_store = VectorStore()
self.brand_style = BrandStyle()
def generate_copy(self, request):
# Move the generation logic from main.py here
similar = self.vector_store.search(request.prompt, request.content_type)
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": self.brand_style.get_prompt(request)},
{"role": "user", "content": f"Prompt: {request.prompt}\n\nSimilar examples:\n{similar}"}
],
temperature=0.7
)
return response.choices[0].message.content