Skip to content

Commit

Permalink
add azure ai foundry
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-bernstein committed Feb 11, 2025
1 parent a0a12e2 commit 4a20000
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ async def submit_batch(batch: BatchData):

@app.post("/validate-connection", response_model=Response[ValidateConnectionResponse])
async def validate_connection(request: ValidateConnectionRequest):
# TODO: move this logic to LSE, this is the last place Adala needs to be updated when adding a provider connection
multi_model_provider_test_models = {
"openai": "gpt-4o-mini",
"vertexai": "vertex_ai/gemini-1.5-flash",
Expand Down Expand Up @@ -290,6 +291,9 @@ async def validate_connection(request: ValidateConnectionRequest):
if provider.lower() == "azureopenai":
model = "azure/" + request.deployment_name
model_extra = {"base_url": request.endpoint}
elif provider.lower() == "azureaifoundry":
model = "azure_ai/" + request.deployment_name
model_extra = {"base_url": request.endpoint}
elif provider.lower() == "custom":
model = "openai/" + request.deployment_name
model_extra = (
Expand Down Expand Up @@ -364,6 +368,8 @@ async def estimate_cost(
agent = request.agent
provider = request.provider
runtime = agent.get_runtime()
with open("cost_estimate.log", "w") as f:
json.dump(request.model_dump(), f, indent=4)

try:
cost_estimates = []
Expand Down

0 comments on commit 4a20000

Please sign in to comment.