Skip to content

Commit

Permalink
add debug options sets
Browse files Browse the repository at this point in the history
  • Loading branch information
juzeon committed Jan 14, 2024
1 parent 5438a88 commit 260228b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ cookies.json
/test
debug.bat
config.lock
debug_options_sets.json
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ Here's the TL;DR version:
3. Clone the project: `git clone https://github.com/juzeon/SydneyQt`.
4. Run the building command: `wails build`.

### Developer Notes

Use `debug_options_sets.json` to overwrite optionsSets, e.g:

```json
[
"fluxsydney",
"iyxapbing",
"iycapbing",
"clgalileoall",
"gencontentv3",
"nojbf"
]
```

## Web API

Thanks to [@PeronGH](https://github.com/PeronGH) we now have a Web API. [Check out for more details.](webapi/README.md)
Expand Down
15 changes: 15 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ Bing禁止特定国家访问Bing AI(具体来说,是sydney.bing.com),所
3. 克隆项目: `git clone https://github.com/juzeon/SydneyQt`
4. 运行构建命令: `wails build`

### Developer Notes

使用文件`debug_options_sets.json`覆写optionsSets,例:

```json
[
"fluxsydney",
"iyxapbing",
"iycapbing",
"clgalileoall",
"gencontentv3",
"nojbf"
]
```

## Web API

感谢 [@PeronGH](https://github.com/PeronGH) 现在我们有了一个 Web API。[点这里查看详情。](webapi/README.md)
Expand Down
8 changes: 8 additions & 0 deletions sydney/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log/slog"
"net/http"
"net/url"
"os"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -276,6 +277,13 @@ func (o *Sydney) AskStreamRaw(options AskStreamOptions) <-chan RawMessage {
if o.noSearch {
optionsSets = append(optionsSets, "nosearchall")
}
debugOptionsSetsFile, _ := os.ReadFile("debug_options_sets.json")
var debugOptionsSets []string
_ = json.Unmarshal(debugOptionsSetsFile, &debugOptionsSets)
if len(debugOptionsSets) != 0 {
slog.Warn("Enable debug options sets", "v", debugOptionsSets)
optionsSets = debugOptionsSets
}
chatMessage := ChatMessage{
Arguments: []Argument{
{
Expand Down

0 comments on commit 260228b

Please sign in to comment.