<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          EdgeGPTBing Chat 逆向工程

          聯(lián)合創(chuàng)作 · 2023-09-25 23:18

          EdgeGPT 是 Bing Chat AI 逆向工程的 API。

          設(shè)置

          安裝模塊

          python3 -m pip install EdgeGPT --upgrade

          要求

          • python 3.8+
          • 一個(gè)已經(jīng)通過候補(bǔ)名單的微軟賬戶 https://bing.com/chat (必填)
          • 需要在 New Bing 支持的國家(中國大陸需使用VPN)

          檢查訪問權(quán)限 (必需)

          • 安裝最新版本的 Microsoft Edge
          • 或者, 您可以使用任何瀏覽器并將用戶代理設(shè)置為Edge的用戶代理 (例如Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51). 您可以使用像 "User-Agent Switcher and Manager" Chrome  Firefox 這樣的擴(kuò)展輕松完成此操作.
          • 打開 bing.com/chat
          • 如果您看到聊天功能,就準(zhǔn)備就緒

          獲取身份驗(yàn)證 (必需)

          • 安裝 Chrome  Firefox 的 cookie editor 擴(kuò)展
          • 移步到 bing.com
          • 打開擴(kuò)展程序
          • 點(diǎn)擊右下角的"導(dǎo)出" (將會把內(nèi)容保存到你的剪貼板上)
          • 把你剪貼板上的內(nèi)容粘貼到 cookies.json 文件中

          圖片生成

          $ python3 -m ImageGen -h
          usage: ImageGen.py [-h] [-U U] [--cookie-file COOKIE_FILE] --prompt PROMPT [--output-dir OUTPUT_DIR] [--quiet] [--asyncio]
          
          optional arguments:
            -h, --help            show this help message and exit
            -U U                  Auth cookie from browser
            --cookie-file COOKIE_FILE
                                  File containing auth cookie
            --prompt PROMPT       Prompt to generate images for
            --output-dir OUTPUT_DIR
                                  Output directory
            --quiet               Disable pipeline messages
            --asyncio             Run ImageGen using asyncio

          開發(fā)演示

          from ImageGen import ImageGen
          import argparse
          import json
          
          async def async_image_gen(args) -> None:
              async with ImageGenAsync(args.U, args.quiet) as image_generator:
                  images = await image_generator.get_images(args.prompt)
                  await image_generator.save_images(images, output_dir=args.output_dir)
          
          if __name__ == "__main__":
              parser = argparse.ArgumentParser()
              parser.add_argument("-U", help="Auth cookie from browser", type=str)
              parser.add_argument("--cookie-file", help="File containing auth cookie", type=str)
              parser.add_argument(
                  "--prompt",
                  help="Prompt to generate images for",
                  type=str,
                  required=True,
              )
              parser.add_argument(
                  "--output-dir",
                  help="Output directory",
                  type=str,
                  default="./output",
              )
              args = parser.parse_args()
              # Load auth cookie
              with open(args.cookie_file, encoding="utf-8") as file:
                  cookie_json = json.load(file)
                  for cookie in cookie_json:
                      if cookie.get("name") == "_U":
                          args.U = cookie.get("value")
                          break
          
              if args.U is None:
                  raise Exception("Could not find auth cookie")
          
              if not args.asyncio:
                  # Create image generator
                  image_generator = ImageGen(args.U, args.quiet)
                  image_generator.save_images(
                      image_generator.get_images(args.prompt),
                      output_dir=args.output_dir,
                  )
              else:
                  asyncio.run(async_image_gen(args))
          
          瀏覽 28
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  九七成人电影 | 久久娱乐精品 | 国产日韩无码视频 | 这里有精品| 欧美一级性爱视频 |