Skip to content

Commit

Permalink
Fix arguments when context is not provided (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsakkas authored Nov 1, 2023
1 parent a3b7a28 commit 2a8cb7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sydney.py

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

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 = "sydney-py"
version = "0.17.0"
version = "0.17.1"
description = "Python Client for Bing Chat, also known as Sydney."
authors = ["vsakkas <[email protected]>"]
license = "MIT"
Expand Down
8 changes: 5 additions & 3 deletions sydney/sydney.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,16 @@ def _build_ask_arguments(
},
"tone": str(self.conversation_style.value),
"conversationId": self.conversation_id,
"previousMessages": [
"previousMessages": [ # Conditionally include this field
{
"author": "user",
"description": context if context else "<EMPTY>",
"description": context,
"contextType": "WebPage",
"messageType": "Context",
}
],
]
if context
else None,
}
],
"invocationId": str(self.invocation_id),
Expand Down

0 comments on commit 2a8cb7f

Please sign in to comment.