- Add model parameter to filter displayed pricing items to a single model - DSPY endpoint accepts ?model=xxx param - Backward compatible: omitting model returns all items
12 lines
500 B
Plaintext
12 lines
500 B
Plaintext
ppid = params_kw.get('ppid')
|
|
model = params_kw.get('model')
|
|
if not ppid:
|
|
return json.dumps({"status": "error", "message": "ppid parameter required"}, ensure_ascii=False)
|
|
|
|
try:
|
|
result = await get_pricing_display(ppid, model)
|
|
return json.dumps({"status": "ok", "data": result}, ensure_ascii=False, default=str)
|
|
except Exception as e:
|
|
exception(f'get_pricing_display({ppid}) failed: {e}\n{format_exc()}')
|
|
return json.dumps({"status": "error", "message": str(e)}, ensure_ascii=False)
|