feat - add prixing for vertex_ai image gen

This commit is contained in:
Ishaan Jaff 2024-05-23 16:27:08 -07:00
parent 580a342fdf
commit e0af091b5e

View file

@ -4659,6 +4659,11 @@ def completion_cost(
or call_type == CallTypes.aimage_generation.value or call_type == CallTypes.aimage_generation.value
): ):
### IMAGE GENERATION COST CALCULATION ### ### IMAGE GENERATION COST CALCULATION ###
if custom_llm_provider == "vertex_ai":
# https://cloud.google.com/vertex-ai/generative-ai/pricing
# Vertex Charges Flat $0.20 per image
return 0.020
# fix size to match naming convention # fix size to match naming convention
if "x" in size and "-x-" not in size: if "x" in size and "-x-" not in size:
size = size.replace("x", "-x-") size = size.replace("x", "-x-")