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

Add ask method for AsyncBard #223

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

jjkoh95
Copy link
Contributor

@jjkoh95 jjkoh95 commented Nov 1, 2023

Description

Add ask method for AsyncBard -- code taken from sync version core.py

Related Issue

Motivation and Context

Expose the same interface for async client (to use extensions, eg google flights, google hotels)

How Has This Been Tested?

Install package

pip install git+https://github.com/jjkoh95/Bard-API.git@async-ask-method

Sample test code

bard = BardAsync(token=c.PSID)
if c.PSIDTS: bard.cookie_dict["__Secure-1PSIDTS"] = c.PSIDTS
if c.PSIDCC: bard.cookie_dict["__Secure-1PSIDCC"] = c.PSIDCC
flights = await bard.ask("@google Flights Search me one way flight for 1 December 2023 from Bangkok, Thailand to Taipei, Taiwan, 2 people.")
print("len(flights.drafts)", len(flights.drafts))

Screenshots (if appropriate):

image
image

@dsdanielpark dsdanielpark merged commit 28a197a into dsdanielpark:main Nov 1, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants