Skip to content

Commit

Permalink
Use old Copilot API to fix Sydney (#190)
Browse files Browse the repository at this point in the history
- Use old [Copilot API](https://edgeservices.bing.com/edgesvc/chat) to
fix Sydney
- Update User Agent and Bundle Version
- Use legacy `websockets` API
- Update README
- Remove cron from Github Action
  • Loading branch information
vsakkas authored Jan 17, 2025
1 parent 6f81c02 commit 42c9d17
Show file tree
Hide file tree
Showing 6 changed files with 874 additions and 753 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
pull_request:
branches:
- master
schedule:
- cron: '0 15 * * 5'

env:
BING_COOKIES: ${{ secrets.BING_COOKIES }}
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="https://raw.githubusercontent.com/vsakkas/sydney.py/master/images/logo.svg" width="28px" /> Sydney.py

[![Latest Release](https://img.shields.io/github/v/release/vsakkas/sydney.py.svg)](https://github.com/vsakkas/sydney.py/releases/tag/v0.22.0)
[![Latest Release](https://img.shields.io/github/v/release/vsakkas/sydney.py.svg)](https://github.com/vsakkas/sydney.py/releases/tag/v0.23.0)
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Managed](https://img.shields.io/badge/managed-poetry-bluegreen.svg?color=blue)](https://github.com/python-poetry/poetry)
[![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/vsakkas/sydney.py/blob/master/LICENSE)
Expand All @@ -24,7 +24,7 @@ Python Client for Copilot (formerly named Bing Chat), also known as Sydney.
## Requirements

- Python 3.9 or newer
- Microsoft account with access to [Copilot](https://copilot.microsoft.com/) *(optional)*
- Microsoft account with access to [Copilot](https://edgeservices.bing.com/edgesvc/chat) *(optional)*

## Installation

Expand All @@ -50,7 +50,7 @@ poetry add sydney-py
To use Sydney.py, you first need to extract all the cookies from the Copilot web page. These cookies are used to authenticate your requests to the Copilot API.

To get the cookies, follow these steps on Microsoft Edge:
- Go to the [Copilot web page](https://copilot.microsoft.com/).
- Go to the [Copilot web page](https://edgeservices.bing.com/edgesvc/chat).
- Open the developer tools in your browser (usually by pressing `F12` or right-clicking on the chat dialog and selecting `Inspect`).
- Select the `Network` tab to view all requests sent to Copilot.
- Write a message on the chat dialog that appears on the web page.
Expand Down Expand Up @@ -78,6 +78,9 @@ os.environ["BING_COOKIES"] = "<your-cookies>"
> [!IMPORTANT]
> For regions where a cookie is required, it is recommended to manually write messages to Copilot until a box containing a `Verifying` message appears, which should then switch to a `Success!` message. Without this step, it is possible that Sydney.py will fail with a `CaptchaChallenge` error.
> [!IMPORTANT]
> Copilot has been redesigned with a new, non-compatible API. Sydney currently uses https://edgeservices.bing.com/edgesvc/chat instead of https://copilot.microsoft.com as a workaround.
### Example

You can use Sydney.py to easily create a CLI client for Copilot:
Expand Down
Loading

0 comments on commit 42c9d17

Please sign in to comment.