main.py
Costs 1 credit
加载编辑器中...
输出 Output执行成功
[错误提示] 检测到中文全角符号(如 ( ) , : ;),Python 语法可能无法解析。 请改成英文半角符号:( ) , : ;
Terminal (Simulated)Install commands are simulated only, no real network requests
$
Step 1: 构造 messages 请求体
创建 system + user 的 messages 结构,符合 Chat Completions 常见格式。
Self-Check List
- 创建 messages 列表
- 包含 role 和 content 字段
- 输出消息数量
Transfer Template
messages = [
{"role": "system", "content": "You are a helpful tutor."},After completing this step, you should be able to independently explain and reproduce this concept, then apply it to similar problems.