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

Commit

Permalink
fix: del unnecessary os import (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Jan 22, 2024
1 parent 5b08b5e commit 3f4dcc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,24 @@ I referred to this github repository([github.com/acheong08/Bard](https://github.
- [More features](#more-features)
- [Amazing Bard Prompts Is All You Need!](#amazing-bard-prompts-is-all-you-need)
- [The Python package hf-transllm](#the-python-package-hf-transllm)
- [Example code of hf-transllm](#example-code-of-hf-transllm)
- [Usage](#usage-1)
- [For LLM that use languages `other than English`](#for-llm-that-use-languages-other-than-english)
- [For LLM that use `English`](#for-llm-that-use-english)
- [What is Google Gemini?](#what-is-google-gemini)
- [Google AI Studio](#google-ai-studio)
- [Access to Gemini Pro in Bard API package](#access-to-gemini-pro-in-bard-api-package)
- [Google PaLM](#google-palm)
- [Quick Start](#quick-start)
- [Sponsor](#sponsor)
- [FAQ](#faq)
- [Scripts](#scripts)
- [Contributors](#contributors)
- [License](#license)
- [Shifting Service Policies: Bard and Google's Dynamics](#shifting-service-policies-bard-and-googles-dynamics)
- [Bugs and Issues](#bugs-and-issues)
- [Contacts](#contacts)
- [Reference](#reference)



Expand Down Expand Up @@ -115,7 +127,6 @@ Bard().get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해
To get reponse dictionary
```python
import bardapi
import os

# set your __Secure-1PSID value to key
token = 'xxxxxxx'
Expand Down Expand Up @@ -146,7 +157,6 @@ bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서
If you are working behind a proxy, use the following.
```python
from bardapi import Bard
import os

# Change 'http://proxy.example.com:8080' to your http proxy
# timeout in seconds
Expand Down Expand Up @@ -194,8 +204,8 @@ session.headers = {
"Origin": "https://bard.google.com",
"Referer": "https://bard.google.com/",
}
session.cookies.set("__Secure-1PSID", os.getenv("_BARD_API_KEY"))
# session.cookies.set("__Secure-1PSID", token)
# session.cookies.set("__Secure-1PSID", os.getenv("_BARD_API_KEY"))
session.cookies.set("__Secure-1PSID", token)

bard = Bard(token=token, session=session, timeout=30)
bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
Expand Down
5 changes: 1 addition & 4 deletions documents/README_DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ chat.start()
or
```python
from bardapi import Bard, SESSION_HEADERS
import os
import requests

token='xxxxxxxx'
Expand Down Expand Up @@ -290,9 +289,8 @@ BardAsync is not using requests library instead it is using httpx library and ht
```python
from httpx import AsyncClient
from bardapi import BardAsync
import os

# Uncomment and set your API key as needed
# import os
# os.environ['_BARD_API_KEY'] = 'xxxxxxx'
token = 'xxxxxxx' # Replace with your actual token

Expand Down Expand Up @@ -379,7 +377,6 @@ BART returns multiple responses as candidate answers. Each of these responses is

```python
from bardapi import Bard, SESSION_HEADERS
import os
import requests

# Set token
Expand Down

0 comments on commit 3f4dcc4

Please sign in to comment.