refactor(llm): optimize Gemini config profiles for extraction and creativity
Introduces `get_extraction_config` and `get_creative_config` to standardize Gemini API calls. * Defines explicit config profiles with appropriate `temperature` and `thinking_level` for Gemini 3 Flash. * Extraction tasks use minimal thinking and temp=0.0 to reduce latency and token usage. * Creative tasks use low thinking, temp=0.4, and top_p=0.8 to balance naturalness and safety. * Applies these helpers across products, routines, and skincare endpoints. * Also updates default model to `gemini-3-flash-preview`.
This commit is contained in:
parent
78df7322a9
commit
ba1f10d99f
5 changed files with 72 additions and 33 deletions
25
backend/test_query.py
Normal file
25
backend/test_query.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from datetime import date, timedelta
|
||||
|
||||
from sqlmodel import select
|
||||
|
||||
from db import get_session
|
||||
from innercontext.models import Routine, RoutineStep
|
||||
|
||||
|
||||
def run():
|
||||
session = next(get_session())
|
||||
ref_date = date.today()
|
||||
cutoff = ref_date - timedelta(days=7)
|
||||
|
||||
recent_usage = session.exec(
|
||||
select(RoutineStep.product_id)
|
||||
.join(Routine, Routine.id == RoutineStep.routine_id)
|
||||
.where(Routine.routine_date >= cutoff)
|
||||
.where(Routine.routine_date <= ref_date)
|
||||
).all()
|
||||
|
||||
print("Found:", len(recent_usage))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
Loading…
Add table
Add a link
Reference in a new issue