Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
chore: style black
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Dec 27, 2023
1 parent d3c81b9 commit da57ff4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bardapi/core_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def __init__(
self.conversation_id = conversation_id or ""
self.response_id = ""
self.choice_id = ""
self.client = self._get_client(session) # Creating an httpx async client for asynchronous core code
self.client = self._get_client(
session
) # Creating an httpx async client for asynchronous core code
self.language = language
self.cookie_dict = {"__Secure-1PSID": self.token}
self.run_code = run_code or False
Expand Down Expand Up @@ -157,18 +159,17 @@ async def _get_client(self, session: Optional[AsyncClient]) -> AsyncClient:
"""
if session is None:
async_client = AsyncClient(
http2=True,
headers=SESSION_HEADERS,
cookies={"__Secure-1PSID": self.token},
timeout=self.timeout,
proxies=self.proxies,
http2=True,
headers=SESSION_HEADERS,
cookies={"__Secure-1PSID": self.token},
timeout=self.timeout,
proxies=self.proxies,
)
return async_client
else:
assert type(session)==AsyncClient
assert type(session) == AsyncClient
return session


async def get_answer(self, input_text: str) -> dict:
"""
Get an answer from the Bard API for the given input text.
Expand Down

0 comments on commit da57ff4

Please sign in to comment.