• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • Content Creation / Rendering

    Project G-Assist ????: Twitch? ??? ???? ???

    Reading Time: 4 minutes

    ??? PC? ???? ?? ??? ?? ????? ?? ???? ??? ??? ??? ???? ?? ??? ????. Project G-Assist? ??? ?????? ?? RTX GPU ? ?? PC ??? ??? ? ??? ??? ???? ????? AI ????????. G-Assist? ???? NVIDIA App ??? ????, ??? ?????, ?? ??? ?????? ? ??? ??? ??? ? ????. ?? NVIDIA App Overlay ??? ??? ??? ???? ???? ???? Alt-Tab ?? ??? ? ????.

    ????? G-Assist? ????? ????? ?? ??? ? ??, ??? ??, Spotify?? ?? ?? ??, IFTTT? ??? ??? ???? ? PC ? ?? ????? ?? ??? ? ????.

    G-Assist? AI ?? ??? PC?? ?? ??? ? ?? ??? ?????. ???? ?? ??? ?? ?? ??(SLM)? ??? ???? ????, ???? ????? ?? ??? ???? ???. GPT ?? ???? ?? ??? ? ??? ?? ???????.

    ?? ??? ?????? Twitch ??? ??? ??, ??? G-Assist ????? ??? ??? ?????. ????? ??? ?????, G-Assist? ??? ?????, ??? ???? ?? ??? ???? ???? ? ????. Python ????, C++ ????, ?? ?? ? ??? ????, ??? ?? ????? ??? ? ??? ??? ??? ???? ???? ?? ????.

    ?? 1. ???? G-Assist ?? ?? ?? ?? ?????

    G-Assist ????? ??????

    G-Assist ????? ??? ??? ???? ?????, G-Assist ????? ??? ???? ??? ????? ?? SLM? ??? ???? ????? ??? ? ?? ????.

    ???? ??? ???? ??? ??? ?? ????, ??? ????? ??? ?? ?? ? SLM? ?? ?????. GitHub? ??? ???? ??? Python ?? C++? ????? ??? ? ????. ???? ?????? ?? ?? ???? ???? ???? ?? ? ???? ?? ??? ???? ??? ?? ? ????.

    ??? 1. ???? G-Assist ???? ??? ??

    ??? ??? ???

    • GPT Plug-in Builder: ???? ?? ??? ???? ??? GPT???. ???? ??? ?? ??, API ? ?? ??, ???? ???? ???? ?????.
    • ???? ??? (Python ? C++): ???? ??, ??, ?? ??, ?? ???? ?? ?? ?? ?? ??????.

    ???? ??: Twitch, Discord, Nanoleaf, IFTTT ?? ? ??? ?? ?? ???? ??? ???? ???? ????.

    Twitch ????: ????? ?? ??? ????

    ?? ??? ???????. ? ????? ?? Twitch ????? ?? ??? ??? ????, ?? ??, ??, ??? ?, ?? ?? ?? ??? ?????.

    ?? ??:

    ninja is LIVE!
    Title: Friday Fortnite!
    Game: Fortnite
    Viewers: 45,231
    Started At: 2024-03-14T12:34:56Z

    ??

    shroud is OFFLINE

    ?? ??

    ????? ????? ??? ?????:

    • ???? Python 3.12? ???? ??? ???
    • Twitch ??? ? (????? ID? ????? ?? ??)
    • GitHub?? ????? G-Assist Python ???? ???

    ???? ??

    ????? ?? ? ?? ?? ??? ?????:

    1.?manifest.json

    ????? ???? ??? ????? ????, ?? ?? G-Assist? ?? ????? ?? ??? ??? ? ??? ???? ???. ?? ? ???? ??? G-Assist SLM? ??? ??? ??? ??? ????, ??? ??? ????? ???? ? ??? ???.

    {
      "manifestVersion": 1,
      "executable": "g-assist-plug-in-twitch.exe",
      "persistent": false,
      "functions": [
        {
          "name": "check_twitch_live_status",
          "description": "Checks if a Twitch user is live and retrieves stream details.",
          "tags": ["twitch", "live_status"],
          "properties": {
            "username": {
              "type": "string",
              "description": "The Twitch username to check."
            }
          }
        }
      ]
    }

    2.?config.json

    Twitch API ??? ??? Twitch Client ID? Secret? ???? ?? ?????. ? ??? ??? ?? ??? ?? ???? ?? ??? ????? ? ???. ???? ????? ??? ???? ???? ???, ?? ??? ??? ??? ???? ?????.

    {
      "TWITCH_CLIENT_ID": "your_client_id_here",
      "TWITCH_CLIENT_SECRET": "your_client_secret_here"
    }

    3.?plug-in.py

    ????? ?? ??? ??? ???, ??, API ??, ?? ??, ??? Windows ?? ???(named pipe)? ?? G-Assist?? ??? ?????.

    ??? ?? ?????:

    def main():
        setup_logging()
        logging.info("Twitch Plugin Started")
      
        while True:
            command = read_command()
            if command is None:
                continue
      
            for tool_call in command.get("tool_calls", []):
                func = tool_call.get("func")
                params = tool_call.get("params", {})
                if func == "check_twitch_live_status":
                    response = check_twitch_live_status(params)
                    write_response(response)
                elif func == "shutdown":
                    return

    ??? ??? ?? JSON ??? ???? ?????:

    {
      "tool_calls": [{
        "func": "check_twitch_live_status",
        "params": {
          "username": "nvidia"
        }
      }]
    }

    ???? ??? ?? ??? ???? ???? ??? ???? ????? ???. G-Assist? Markdown ??? ?????:

    {
      "success": true,
      "message": "nvidia is LIVE!\nTitle: NVIDIA Gaming Stream\nGame: Cyberpunk 2077\nViewers: 1234"
    }<<END>>

    Windows ?? ?? ??? ??

    G-Assist? ????? Windows? “?? ???(named pipes)”? ?? ?????. ?? ??? JSON ??? ???? ????? ????, ??? ??? ???? ???? ??? ?? ??? <<END>> ??? ??? ???? ???.

    read_command? write_response ??? ???? ???? ???? ????. read_command? ??? ??? ??? ? ??? ?? ??? ???? ??, write_response? ?? ??? ???? ?? ?? ??? ?????. ?? ??? ????? ????, ???? ?? ???? ???? ???.

    Twitch API ??

    Twitch? ???? ?? OAuth 2.0 ????? ?? ?? ??? ?????:

    def get_oauth_token():
        try:
            response = requests.post(
                TWITCH_OAUTH_URL,
                params={
                    "client_id": config.get("TWITCH_CLIENT_ID"),
                    "client_secret": config.get("TWITCH_CLIENT_SECRET"),
                    "grant_type": "client_credentials"
                }
            )
            return response.json().get("access_token")
        except Exception as e:
            logging.error(f"Error getting OAuth token: {e}")
            return None

    ??? ??? ?, ???? ??? ???? ?????:

    def check_twitch_live_status(params: Dict[str, str]):
        username = params.get("username")
        oauth_token = get_oauth_token()
      
        headers = {
            "Client-ID": config.get("TWITCH_CLIENT_ID"),
            "Authorization": f"Bearer {oauth_token}"
        }
      
        response = requests.get(
            TWITCH_STREAM_URL,
            headers=headers,
            params={"user_login": username}
        )
      
        data = response.json().get("data", [])
        if data:
            stream = data[0]
            return {
                "success": True,
                "message": (
                    f"{username} is LIVE!\n"
                    f"Title: {stream['title']}\n"
                    f"Game: {stream.get('game_name', 'Unknown')}\n"
                    f"Viewers: {stream['viewer_count']}"
                )
            }
        return {"success": True, "message": f"{username} is OFFLINE"}

    ? ?? ???? ????

    GitHub?? G-Assist? ???? ??? ??? ???? ???? ??? ?? ???? ????.

    • IFTTT ????: “?? ??!”?? ??? ?? ?? ??? ???? ???? ??? ??? ? ????.
    • Discord ????: ??? ?? ?? Discord ??? ???, ???, ???? ??? ? ????. ?? ?? ??, ?? ?? ??, ?? ??? ???? ?? ??? ??? ?? ????.
    • Nanoleaf ????: IP ???? Nanoleaf ??? ????, G-Assist ??? ?? ?? ???? ?? ??? ?????. ???? ??? ??? ??, ?? ?? ?? ??, ?? ?? ?? ??? ??? ? ????.

    ? ??? ?? ?? ?? ??? ??? ????, ?? ?? ??? ???? ???? ????, ????, ??? ? ????.

    7? 16??? Plug and Play ???? ?????

    Project G-Assist ????? ?? ????? Plug and Play ???? ????? ???? ?????. ?? ??? ??? ??? ????, ?? ??? ????, ?? ??? ?? AI ?????? ???? ??? G-Assist ????? ???? ???. ? ????? ??????? ????, ???? ?? ??? ???? AI ?? ??? ?????. ??? ????? ?? ??? ???? ??? (??? ??? Plug and Play ??? ??).

    ??? ???? ???? NVIDIA GeForce RTX 5090 ???, RTX 5080 GPU, ?? RTX 5070 GPU? ?? ??? ?? ???.

    ???? ???? 2025? 7? 16??? ?????.

    ????? ?????

    ??? ???? ??? ????? ???? ???? ?????? ???. G-Assist GitHub?? ???, ?? ??, ??? ?? ??? ? ????.

    ????? ?? ??? ?? ??? ? ??? ???, 2025? 7? 9?? ??? ???? RTX AI Workshop: How to Build a Project G-Assist Plug-In? ??? ?????. NVIDIA ?? ??? ?? ???? ????? ?? ??? ? ?? ?????.

    ?? Discord? ??? ???? ???? ????, G-Assist ?? ??? ????? ???? ? NVIDIA ????? ??? ?? ? ????.

    ?? ???

    Discuss (0)
    +1

    Tags

    人人超碰97caoporen国产