Skip to content

Commit

Permalink
ADDED: Gemini Flash support in blog generation route
Browse files Browse the repository at this point in the history
  • Loading branch information
AquibPy committed May 24, 2024
1 parent 2206bd1 commit a7c7153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ async def blogs(topic: str = Form("Generative AI")):
print("Retrieving response from Redis cache")
return ResponseText(response=cached_response.decode("utf-8"))

model = genai.GenerativeModel(settings.GEMINI_PRO_1_5)
model = genai.GenerativeModel(settings.GEMINI_FLASH)
blog_prompt = f""" You are expert in blog writing. Write a blog on the topic {topic}. Use a friendly and informative tone, and include examples and tips to encourage readers to get started with the topic provided. """
response = model.generate_content(blog_prompt)
redis.set(cache_key, response.text, ex=60)
Expand Down
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GEMINI_PRO = "gemini-pro"
GEMINI_PRO_1_5 = "gemini-1.5-pro-latest"
GEMINI_FLASH = "gemini-1.5-flash-latest"
GOOGLE_EMBEDDING = "models/embedding-001"
FAQ_FILE = 'data/faqs.csv'
EMPLOYEE_DB = "data/employees.db"
Expand Down

0 comments on commit a7c7153

Please sign in to comment.