打开第一步创建的仓库,修改 wrangler.toml 和 .github/workflows/deploy.yml 文件,将第二步创建的项目 name 和 ID 替换到文件对应位置。wrangler.toml 第一行的 name 既是自动部署成功后 cloudflare worker 的名称,可以自行修改。
因为当时刚好看到木木老师在“哔哔广场”发了一条内容为 『有研究表明,人在消极情绪状态下,做精细的且需要耐心的工作会更好。所以,我们在大学生身上常见到的一种表现是:人一失恋,就容易过英语六级。』 的哔哔,于是在发博客的时候给自己的折腾找了个失恋的理由,没想到大家注意力都转到了“失恋”上去,没人关心那折腾了一半的 Hugo 主题。
蓝牙游戏手柄:Sony Dual shock 4、Sony Dual Sense 控制器、Sony DualSense Edge 控制器、Microsoft Xbox One S 控制器、Microsoft Xbox Series X 控制器、Microsoft Xbox Adaptive 控制器、NVIDIA SHlELD 控制器 Amazon Luna 控制器、Shaks S3b、Shaks s2b、Nintendo Switch Pro 控制器、Nintendo Joy-con 控制器、MOGA XP5-X Plus 控制器
此功能仅适用于支持蓝牙的型号!
连接多个蓝牙设备可能会导致连接不良或操作不当。
The device you’ve previously connected to, it connects automatically. To disconnect the existing connection, click Disconnect.
It is recommended that you use a product that has been tested forcompatibility with this devices.
Bluetooth Mouse: Logitech M535, Logitech Mx Master 2s, Apple Magic Mouse 2
Bluetooth Keyboard: Logitech K480, Arteck HB030B, Arteck HB192, Apple Magic Keyboard
Bluetooth Gamepad: Sony Dual shock 4, Sony Dual Sense Controller, Sony DualSense Edge Controller, Microsoft Xbox One S Controller, Microsoft Xbox Series X Controller, Microsoft Xbox Adaptive Controller, NVIDIA SHlELD Controller Amazon Luna Controller, Shaks S3b, Shaks s2b, Nintendo Switch Pro Controller, Nintendo Joy-con Controller, MOGA XP5-X Plus Controller
This feature is available for Bluetooth-enabled models only!
Connecting multiple Bluetooth devices may result in poor connection or operation.
输入这个型号的时候,我还专程打开手机查看核实,因为就感觉未曾换过新iPhone,也忘记现在最新发布的是 16 还是 15 代,之所有买港版是为了AI,但它并不怎么AI,而新的摄影按钮暂时来说有点多余,没有三星长按最底下横杠启用AI圈图搜索方式。iPhone 16 Pro Max 现已放备用机在使用,上面都是一些金融类APP在上面。
import requests
import json
api_key = "x_ai ..."
# Define the API endpoint and headers
url = "https://api.x.ai/v1/chat/completions"
headers = {
"Content-Type": "application/json",
f"Authorization": "Bearer {api_key}",
}
# Define a system message for context
system_message = {"role": "system", "content": "You are a test assistant."}
print("Welcome to the Grok, an AI chatbot. Type 'bye' to exit.\n")
while True:
# Prompt the user for input
user_input = input("You: ").strip()
# Check if the user wants to exit
if user_input.lower() == "bye":
print("Goodbye!")
break
if user_input == "":
continue
# Define the payload
payload = {
"messages": [
system_message,
{"role": "user", "content": user_input}
],
"model": "grok-beta",
"stream": False,
"temperature": 0
}
try:
# Make the request
response = requests.post(url, headers=headers, json=payload)
# Check the response status
if response.status_code == 200:
data = response.json()
assistant_response = data["choices"][0]["message"]["content"]
print(f"Grok: {assistant_response}\n")
else:
print(f"Error: {response.status_code} - {response.text}")
except Exception as e:
print(f"An error occurred: {e}")