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

Improve compatibilty of request arguments #13

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="https://raw.githubusercontent.com/vsakkas/bard.py/master/images/logo.svg?token=GHSAT0AAAAAAB7MEK465TODCKRPHN3YQY54ZKGUN4Q" width="28px" /> Bard.py

[![Latest Release](https://img.shields.io/github/v/release/vsakkas/bard.py.svg)](https://github.com/vsakkas/bard.py/releases/tag/v0.2.2)
[![Latest Release](https://img.shields.io/github/v/release/vsakkas/bard.py.svg)](https://github.com/vsakkas/bard.py/releases/tag/v0.2.3)
[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/vsakkas/bard.py/blob/master/LICENSE)

Expand Down
20 changes: 18 additions & 2 deletions bard/bard.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,25 @@ def _build_ask_parameters(self) -> dict:

def _build_ask_arguments(self, prompt: str) -> dict:
request_data = [
[prompt],
[prompt, 0, None, [], None, None, 0],
[""], # TODO: Support language codes, like "en"
[
self.conversation_id if self.conversation_id else "",
"",
"",
self.response_id if self.response_id else None,
self.choice_id if self.choice_id else None,
[],
],
"", # TODO: Find what this is
"", # TODO: Find what this is
None,
[self.conversation_id, self.response_id, self.choice_id],
[1],
1,
[],
[],
1,
0,
]

return {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bard-py"
version = "0.2.2"
version = "0.2.3"
description = "Python Client for Bard."
authors = ["vsakkas <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


@pytest.mark.asyncio
async def test_ask() -> None:
async def test_ask() -> bool:
expected_responses = [
"Hello there! How can I help you today?",
"Hello there! How can I help you today? [Image of Bard AI Chatbot]",
Expand Down