Skip to content

Commit

Permalink
Update embedding dependency to support system assigned MI
Browse files Browse the repository at this point in the history
  • Loading branch information
abhahn committed Aug 5, 2024
1 parent 4003f18 commit a474b71
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,24 @@ def extract_embedding_dependency(self) -> Optional[dict]:
"type": "deployment_name",
"deployment_name": self.embedding_name
}

elif self.embedding_endpoint and self.embedding_key:
return {
"type": "endpoint",
"endpoint": self.embedding_endpoint,
"authentication": {
"type": "api_key",
"api_key": self.embedding_key
elif self.embedding_endpoint:
if self.embedding_key:
return {
"type": "endpoint",
"endpoint": self.embedding_endpoint,
"authentication": {
"type": "api_key",
"api_key": self.embedding_key
}
}
else:
return {
"type": "endpoint",
"endpoint": self.embedding_endpoint,
"authentication": {
"type": "system_assigned_managed_identity"
}
}
}
else:
return None

Expand Down

0 comments on commit a474b71

Please sign in to comment.