(self, credentials: BundleCredentials)
| 6 | |
| 7 | class Dalle3(BundleHandler): |
| 8 | async def verify(self, credentials: BundleCredentials): |
| 9 | openai_api_key: str = credentials.credentials.get("OPENAI_API_KEY") |
| 10 | |
| 11 | url = "https://api.openai.com/v1/models" |
| 12 | headers = { |
| 13 | "Authorization": f"Bearer {openai_api_key}", |
| 14 | "Content-Type": "application/json" |
| 15 | } |
| 16 | |
| 17 | async with ClientSession() as session: |
| 18 | async with session.get(url=url, headers=headers, proxy=CONFIG.PROXY) as response: |
| 19 | if response.status == 200: |
| 20 | pass |
| 21 | else: |
| 22 | raise_credentials_validation_error() |
nothing calls this directly
no test coverage detected