欢迎光临
我们一直在努力

基于大模型API聚合站构建个性化AI英语学习工具:从二语习得理论到工程实践

工具推荐:本文所有代码示例均基于 AI地域 API聚合站 的 OpenAI 兼容接口实现,该平台提供 gemini-2.5-flash-lite 等免费模型,非常适合英语学习场景的低成本调用。

1 引言:当大语言模型遇见二语习得

语言学习是人类认知活动中最具挑战性的任务之一。传统课堂受限于师资配比、时间成本和个性化程度,难以实现"因材施教"的理想状态。而大语言模型(Large Language Model, LLM)的出现,为计算机辅助语言学习(Computer Assisted Language Learning, CALL)带来了范式级的变革。LLM 不仅具备海量的语言知识储备,更能够根据学习者的输入进行上下文感知的即时交互,这种能力与二语习得理论中"可理解性输入"和"意义协商"的核心诉求高度契合。

从技术演进的角度看,CALL 的发展经历了三个重要阶段:行为主义驱动的操练系统(如 PLATO)、交际法驱动的多媒体交互系统(如 CD-ROM 时代的教学软件),以及当前以 LLM 为核心的智能对话系统。每一个阶段的跃迁,都伴随着底层技术架构的深刻变革。当前阶段的核心特征在于:学习者不再与预设的脚本交互,而是与一个具备涌现能力的语言模型进行开放式的对话练习。

然而,直接调用 LLM 原始 API 存在诸多门槛:海外模型的网络访问限制、不同厂商 API 格式的差异、按量计费的成本控制等。API 聚合站(也称 API 中转站)的出现有效解决了这些问题——它通过统一的 OpenAI 兼容接口协议,将多家模型厂商的 API 聚合在一个平台上,开发者只需更换 base_url 和 api_key 即可无缝切换模型。本文将以 AI地域 为例,系统性地讲解如何利用 API 聚合站搭建一套完整的 AI 英语学习工具,涵盖理论基础、架构设计、提示词工程、Python 实现和 HTML 版本搭建。

#mermaid-svg-zUSOIQIUGyZJ07fP{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-zUSOIQIUGyZJ07fP .error-icon{fill:#552222;}#mermaid-svg-zUSOIQIUGyZJ07fP .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-zUSOIQIUGyZJ07fP .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-zUSOIQIUGyZJ07fP .marker{fill:#333333;stroke:#333333;}#mermaid-svg-zUSOIQIUGyZJ07fP .marker.cross{stroke:#333333;}#mermaid-svg-zUSOIQIUGyZJ07fP svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-zUSOIQIUGyZJ07fP p{margin:0;}#mermaid-svg-zUSOIQIUGyZJ07fP .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster-label text{fill:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster-label span{color:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster-label span p{background-color:transparent;}#mermaid-svg-zUSOIQIUGyZJ07fP .label text,#mermaid-svg-zUSOIQIUGyZJ07fP span{fill:#333;color:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP .node rect,#mermaid-svg-zUSOIQIUGyZJ07fP .node circle,#mermaid-svg-zUSOIQIUGyZJ07fP .node ellipse,#mermaid-svg-zUSOIQIUGyZJ07fP .node polygon,#mermaid-svg-zUSOIQIUGyZJ07fP .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-zUSOIQIUGyZJ07fP .rough-node .label text,#mermaid-svg-zUSOIQIUGyZJ07fP .node .label text,#mermaid-svg-zUSOIQIUGyZJ07fP .image-shape .label,#mermaid-svg-zUSOIQIUGyZJ07fP .icon-shape .label{text-anchor:middle;}#mermaid-svg-zUSOIQIUGyZJ07fP .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-zUSOIQIUGyZJ07fP .rough-node .label,#mermaid-svg-zUSOIQIUGyZJ07fP .node .label,#mermaid-svg-zUSOIQIUGyZJ07fP .image-shape .label,#mermaid-svg-zUSOIQIUGyZJ07fP .icon-shape .label{text-align:center;}#mermaid-svg-zUSOIQIUGyZJ07fP .node.clickable{cursor:pointer;}#mermaid-svg-zUSOIQIUGyZJ07fP .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-zUSOIQIUGyZJ07fP .arrowheadPath{fill:#333333;}#mermaid-svg-zUSOIQIUGyZJ07fP .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-zUSOIQIUGyZJ07fP .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-zUSOIQIUGyZJ07fP .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-zUSOIQIUGyZJ07fP .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-zUSOIQIUGyZJ07fP .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-zUSOIQIUGyZJ07fP .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster text{fill:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP .cluster span{color:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-zUSOIQIUGyZJ07fP .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-zUSOIQIUGyZJ07fP rect.text{fill:none;stroke-width:0;}#mermaid-svg-zUSOIQIUGyZJ07fP .icon-shape,#mermaid-svg-zUSOIQIUGyZJ07fP .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-zUSOIQIUGyZJ07fP .icon-shape p,#mermaid-svg-zUSOIQIUGyZJ07fP .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-zUSOIQIUGyZJ07fP .icon-shape rect,#mermaid-svg-zUSOIQIUGyZJ07fP .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-zUSOIQIUGyZJ07fP .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-zUSOIQIUGyZJ07fP .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-zUSOIQIUGyZJ07fP :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

二语习得理论

CALL系统设计

LLM技术架构

API聚合站

AI英语学习工具

词汇学习模块

语法纠错模块

口语对话模块

写作批改模块

2 二语习得理论基础与LLM的契合性分析

2.1 Krashen输入假说与LLM的输入供给能力

Krashen 于 1982 年提出的输入假说(Input Hypothesis)是二语习得领域最具影响力的理论之一。该假说的核心主张是:语言习得发生在学习者接收到"i+1"水平的输入时——即略高于学习者当前语言水平(i)的可理解性输入。这一公式可以形式化地表示为:

i

i

+

1

当且仅当

Input

[

i

,

i

+

1

]

i \\rightarrow i+1 \\quad \\text{当且仅当} \\quad \\text{Input} \\in [i, i+1]

ii+1当且仅当Input[i,i+1]

其中,

i

i

i 表示学习者当前的语言能力水平,

i

+

1

i+1

i+1 表示下一阶段的发展水平。输入假说进一步包含五个核心假设:习得-学得差异假设、自然顺序假设、监控假设、输入假设和情感过滤假设。其中,情感过滤假设指出,学习者的焦虑、自信心不足等负面情绪会形成一道"情感过滤器",阻碍可理解性输入的吸收。

LLM 在供给可理解性输入方面具有天然优势。通过精心设计的系统提示词(System Prompt),我们可以指示模型根据学习者的水平调整输出难度。例如,对于初级学习者,模型可以使用更简单的词汇和句式结构;对于高级学习者,则可以引入更复杂的表达和地道用法。这种动态调节能力是传统教材无法实现的。更重要的是,LLM 提供的是一个低焦虑的交互环境——学习者不必担心犯错被嘲笑,这与情感过滤假设中降低焦虑的诉求完全一致。

2.2 Swain输出假说与AI驱动的语言产出训练

Swain(1985)在对加拿大沉浸式教学法的研究中提出了输出假说(Output Hypothesis),认为仅仅接收可理解性输入不足以实现高水平的二语习得,学习者还需要"被推动"去产出可理解性输出。Swain 指出,输出在二语习得中发挥三个关键功能:注意功能(noticing)——产出过程中学习者会注意到自身语言知识的缺口;假设验证功能(hypothesis testing)——学习者通过输出测试其中介语假设;元语言反思功能(metalinguistic reflection)——产出促使学习者对语言形式进行反思。

在 AI 英语学习工具中,输出假说的实践体现为:模型不仅充当输入的提供者,更充当输出的反馈者。当学习者尝试用英语表达时,模型可以即时提供纠错、改写和解释,形成"产出-反馈-修正"的闭环。这种闭环的效率远超传统课堂中的教师批改,因为反馈是即时的、个性化的,且不受时间地点限制。

2.3 Long交互假说与LLM对话机制

Long(1996)提出的交互假说(Interaction Hypothesis)强调,语言习得的关键机制在于"意义协商"(negotiation of meaning)。当交际中出现理解困难时,对话双方会通过确认核实、理解核实和澄清请求等策略进行意义协商,这一过程恰好为学习者提供了额外的可理解性输入和输出机会。

LLM 的对话机制天然支持意义协商。当学习者的表达不够清晰时,模型可以主动请求澄清;当模型使用了学习者不理解的词汇时,学习者可以追问,模型会提供简明的解释。这种双向的交互协商过程,正是 Long 交互假说在数字环境中的完美实现。

二语习得理论核心主张LLM契合点AI工具实现方式
Krashen输入假说 i+1可理解性输入 动态调节输出难度 分级提示词+自适应对话
Swain输出假说 推动可理解性输出 即时纠错与反馈 写作批改+口语练习
Long交互假说 意义协商促进习得 双向对话协商 多轮对话+追问机制
Vygotsky最近发展区 脚手架式辅助 渐进式引导 逐步提升任务难度

#mermaid-svg-SikPKetU8gAktbh4{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-SikPKetU8gAktbh4 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-SikPKetU8gAktbh4 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-SikPKetU8gAktbh4 .error-icon{fill:#552222;}#mermaid-svg-SikPKetU8gAktbh4 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-SikPKetU8gAktbh4 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-SikPKetU8gAktbh4 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-SikPKetU8gAktbh4 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-SikPKetU8gAktbh4 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-SikPKetU8gAktbh4 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-SikPKetU8gAktbh4 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-SikPKetU8gAktbh4 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-SikPKetU8gAktbh4 .marker.cross{stroke:#333333;}#mermaid-svg-SikPKetU8gAktbh4 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-SikPKetU8gAktbh4 p{margin:0;}#mermaid-svg-SikPKetU8gAktbh4 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-SikPKetU8gAktbh4 .cluster-label text{fill:#333;}#mermaid-svg-SikPKetU8gAktbh4 .cluster-label span{color:#333;}#mermaid-svg-SikPKetU8gAktbh4 .cluster-label span p{background-color:transparent;}#mermaid-svg-SikPKetU8gAktbh4 .label text,#mermaid-svg-SikPKetU8gAktbh4 span{fill:#333;color:#333;}#mermaid-svg-SikPKetU8gAktbh4 .node rect,#mermaid-svg-SikPKetU8gAktbh4 .node circle,#mermaid-svg-SikPKetU8gAktbh4 .node ellipse,#mermaid-svg-SikPKetU8gAktbh4 .node polygon,#mermaid-svg-SikPKetU8gAktbh4 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-SikPKetU8gAktbh4 .rough-node .label text,#mermaid-svg-SikPKetU8gAktbh4 .node .label text,#mermaid-svg-SikPKetU8gAktbh4 .image-shape .label,#mermaid-svg-SikPKetU8gAktbh4 .icon-shape .label{text-anchor:middle;}#mermaid-svg-SikPKetU8gAktbh4 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-SikPKetU8gAktbh4 .rough-node .label,#mermaid-svg-SikPKetU8gAktbh4 .node .label,#mermaid-svg-SikPKetU8gAktbh4 .image-shape .label,#mermaid-svg-SikPKetU8gAktbh4 .icon-shape .label{text-align:center;}#mermaid-svg-SikPKetU8gAktbh4 .node.clickable{cursor:pointer;}#mermaid-svg-SikPKetU8gAktbh4 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-SikPKetU8gAktbh4 .arrowheadPath{fill:#333333;}#mermaid-svg-SikPKetU8gAktbh4 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-SikPKetU8gAktbh4 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-SikPKetU8gAktbh4 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-SikPKetU8gAktbh4 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-SikPKetU8gAktbh4 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-SikPKetU8gAktbh4 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-SikPKetU8gAktbh4 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-SikPKetU8gAktbh4 .cluster text{fill:#333;}#mermaid-svg-SikPKetU8gAktbh4 .cluster span{color:#333;}#mermaid-svg-SikPKetU8gAktbh4 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-SikPKetU8gAktbh4 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-SikPKetU8gAktbh4 rect.text{fill:none;stroke-width:0;}#mermaid-svg-SikPKetU8gAktbh4 .icon-shape,#mermaid-svg-SikPKetU8gAktbh4 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-SikPKetU8gAktbh4 .icon-shape p,#mermaid-svg-SikPKetU8gAktbh4 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-SikPKetU8gAktbh4 .icon-shape rect,#mermaid-svg-SikPKetU8gAktbh4 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-SikPKetU8gAktbh4 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-SikPKetU8gAktbh4 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-SikPKetU8gAktbh4 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

LLM能力映射

二语习得理论框架

Krashen输入假说i+1输入

Swain输出假说可理解性输出

Long交互假说意义协商

Vygotsky最近发展区脚手架辅助

动态难度调节

即时反馈纠错

多轮对话协商

渐进式引导

3 大语言模型技术原理与API架构

3.1 Transformer架构与自注意力机制

当前所有主流 LLM 均基于 Transformer 架构。Transformer 的核心创新在于自注意力机制(Self-Attention),它允许模型在处理序列中的每个位置时,直接关注序列中的所有其他位置,从而捕获长距离依赖关系。自注意力的计算过程可以表示为:

Attention

(

Q

,

K

,

V

)

=

softmax

(

Q

K

T

d

k

)

V

\\text{Attention}(Q, K, V) = \\text{softmax}\\left(\\frac{QK^T}{\\sqrt{d_k}}\\right)V

Attention(Q,K,V)=softmax(dk

QKT)V

其中,

Q

Q

Q(Query)、

K

K

K(Key)、

V

V

V(Value)分别由输入序列经线性变换得到,

d

k

d_k

dk 为 Key 向量的维度,除以

d

k

\\sqrt{d_k}

dk

的目的是防止点积值过大导致 softmax 梯度消失。在多头注意力(Multi-Head Attention)中,模型并行地执行

h

h

h 次注意力计算,每次使用不同的线性投影,然后将结果拼接:

MultiHead

(

Q

,

K

,

V

)

=

Concat

(

head

1

,

.

.

.

,

head

h

)

W

O

\\text{MultiHead}(Q, K, V) = \\text{Concat}(\\text{head}_1, …, \\text{head}_h)W^O

MultiHead(Q,K,V)=Concat(head1,,headh)WO

head

i

=

Attention

(

Q

W

i

Q

,

K

W

i

K

,

V

W

i

V

)

\\text{head}_i = \\text{Attention}(QW_i^Q, KW_i^K, VW_i^V)

headi=Attention(QWiQ,KWiK,VWiV)

这种多头机制使模型能够同时关注不同子空间的信息,增强了模型的表达能力。对于英语学习场景而言,多头注意力使模型能够同时关注语法结构、语义关系和语用信息,这是其能够进行高质量语言辅导的底层技术基础。

3.2 自回归生成与Chat Completions接口

LLM 的文本生成采用自回归方式,即在给定前文

x

<

t

x_{<t}

x<t 的条件下,逐词预测下一个词的概率分布:

P

(

x

t

x

<

t

)

=

softmax

(

W

h

t

)

P(x_t | x_{<t}) = \\text{softmax}(W \\cdot h_t)

P(xtx<t)=softmax(Wht)

其中

h

t

h_t

ht 是 Transformer 最后一层在位置

t

t

t 的隐藏状态,

W

W

W 是词嵌入矩阵的转置。生成过程通常采用温度采样(Temperature Sampling)策略:

P

temp

(

x

t

x

<

t

)

=

exp

(

log

P

(

x

t

x

<

t

)

/

T

)

x

exp

(

log

P

(

x

x

<

t

)

/

T

)

P_{\\text{temp}}(x_t | x_{<t}) = \\frac{\\exp(\\log P(x_t | x_{<t}) / T)}{\\sum_{x'} \\exp(\\log P(x' | x_{<t}) / T)}

Ptemp(xtx<t)=xexp(logP(xx<t)/T)exp(logP(xtx<t)/T)

温度参数

T

T

T 控制生成的随机性:

T

0

T \\to 0

T0 时趋近贪心解码,

T

>

1

T > 1

T>1 时增加多样性。在英语学习场景中,较低的

T

T

T 值适合语法讲解等需要准确性的任务,较高的

T

T

T 值适合创意写作等需要多样性的任务。

OpenAI 定义的 Chat Completions 接口已成为事实标准,API 聚合站普遍兼容该协议。其请求格式如下:

POST /v1/chat/completions
{
"model": "gemini-2.5-flash-lite",
"messages": [
{"role": "system", "content": "You are an English tutor."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 1024
}

响应格式包含模型生成的回复及使用量信息。API 聚合站的核心价值在于:开发者只需将 base_url 指向聚合站地址,即可用同一套代码调用不同厂商的模型,无需适配各家 API 的差异。

3.3 API聚合站的技术架构

API 聚合站本质上是一个高性能的 API 网关与聚合服务层,位于开发者与全球 AI 模型厂商之间。其技术架构可以抽象为以下层次:

#mermaid-svg-jd3AX7AJpObfZz9t{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-jd3AX7AJpObfZz9t .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-jd3AX7AJpObfZz9t .error-icon{fill:#552222;}#mermaid-svg-jd3AX7AJpObfZz9t .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-jd3AX7AJpObfZz9t .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-jd3AX7AJpObfZz9t .marker{fill:#333333;stroke:#333333;}#mermaid-svg-jd3AX7AJpObfZz9t .marker.cross{stroke:#333333;}#mermaid-svg-jd3AX7AJpObfZz9t svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-jd3AX7AJpObfZz9t p{margin:0;}#mermaid-svg-jd3AX7AJpObfZz9t .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-jd3AX7AJpObfZz9t .cluster-label text{fill:#333;}#mermaid-svg-jd3AX7AJpObfZz9t .cluster-label span{color:#333;}#mermaid-svg-jd3AX7AJpObfZz9t .cluster-label span p{background-color:transparent;}#mermaid-svg-jd3AX7AJpObfZz9t .label text,#mermaid-svg-jd3AX7AJpObfZz9t span{fill:#333;color:#333;}#mermaid-svg-jd3AX7AJpObfZz9t .node rect,#mermaid-svg-jd3AX7AJpObfZz9t .node circle,#mermaid-svg-jd3AX7AJpObfZz9t .node ellipse,#mermaid-svg-jd3AX7AJpObfZz9t .node polygon,#mermaid-svg-jd3AX7AJpObfZz9t .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-jd3AX7AJpObfZz9t .rough-node .label text,#mermaid-svg-jd3AX7AJpObfZz9t .node .label text,#mermaid-svg-jd3AX7AJpObfZz9t .image-shape .label,#mermaid-svg-jd3AX7AJpObfZz9t .icon-shape .label{text-anchor:middle;}#mermaid-svg-jd3AX7AJpObfZz9t .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-jd3AX7AJpObfZz9t .rough-node .label,#mermaid-svg-jd3AX7AJpObfZz9t .node .label,#mermaid-svg-jd3AX7AJpObfZz9t .image-shape .label,#mermaid-svg-jd3AX7AJpObfZz9t .icon-shape .label{text-align:center;}#mermaid-svg-jd3AX7AJpObfZz9t .node.clickable{cursor:pointer;}#mermaid-svg-jd3AX7AJpObfZz9t .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-jd3AX7AJpObfZz9t .arrowheadPath{fill:#333333;}#mermaid-svg-jd3AX7AJpObfZz9t .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-jd3AX7AJpObfZz9t .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-jd3AX7AJpObfZz9t .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jd3AX7AJpObfZz9t .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-jd3AX7AJpObfZz9t .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jd3AX7AJpObfZz9t .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-jd3AX7AJpObfZz9t .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-jd3AX7AJpObfZz9t .cluster text{fill:#333;}#mermaid-svg-jd3AX7AJpObfZz9t .cluster span{color:#333;}#mermaid-svg-jd3AX7AJpObfZz9t div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-jd3AX7AJpObfZz9t .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-jd3AX7AJpObfZz9t rect.text{fill:none;stroke-width:0;}#mermaid-svg-jd3AX7AJpObfZz9t .icon-shape,#mermaid-svg-jd3AX7AJpObfZz9t .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jd3AX7AJpObfZz9t .icon-shape p,#mermaid-svg-jd3AX7AJpObfZz9t .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-jd3AX7AJpObfZz9t .icon-shape rect,#mermaid-svg-jd3AX7AJpObfZz9t .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jd3AX7AJpObfZz9t .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-jd3AX7AJpObfZz9t .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-jd3AX7AJpObfZz9t :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

模型供应商层

聚合站网关层

客户端层

Python应用

HTML/JS前端

其他SDK

请求路由

协议适配

负载均衡

密钥管理

流量控制

Google Gemini

OpenAI GPT

Anthropic Claude

其他模型

聚合站的关键技术特性包括:协议统一化(将不同厂商的 API 格式统一为 OpenAI 兼容格式)、智能路由(根据模型可用性和延迟自动选择最优路径)、密钥托管(用户只需管理一个 API Key)、流量控制(防止滥用和保障服务质量)。对于英语学习工具的开发者而言,这意味着极低的接入成本和极高的模型可及性。

4 API聚合站选型与环境配置

4.1 为什么选择API聚合站

直接调用海外模型 API 面临三重挑战:网络访问限制、多模型管理复杂、成本控制困难。API 聚合站通过统一的接入层解决了这些问题。以 AI地域 为例,该平台提供以下核心能力:

  • 统一接口:完全兼容 OpenAI API 格式,只需修改 base_url 即可接入
  • 模型丰富:支持 Gemini、GPT、Claude 等主流模型家族的最新版本
  • 免费模型:提供 gemini-2.5-flash-lite 等免费模型,适合学习和开发测试
  • 国内直连:无需额外网络配置,国内环境即可直接调用

4.2 注册与API Key获取

访问 AI地域注册页面 完成注册后,在控制台的"API 密钥"页面创建新的密钥。密钥格式通常为 sk-xxxxxxxx,请妥善保存。注册流程简洁,邮箱验证后即可获得免费额度。

4.3 模型选型与英语学习场景适配

在模型广场中,不同模型适用于不同的英语学习场景。以下是关键模型的对比分析:

模型名称上下文窗口适用场景费用英语学习适配度
gemini-2.5-flash-lite 1M tokens 词汇查询、简单对话、语法讲解 免费 极高
gemini-2.5-flash 1M tokens 写作批改、长文阅读理解
gemini-2.5-pro 1M tokens 复杂推理、深度语法分析
claude-sonnet-4-20250514 200K tokens 写作润色、文学分析
gpt-4.1 1M tokens 综合能力、多模态 中高

其中,gemini-2.5-flash-lite 是英语学习场景的首选模型。它拥有 100 万 token 的超长上下文窗口,支持多模态输入(文本、图片、音频),且完全免费。对于日常的词汇学习、语法查询和简单对话练习,该模型的性能完全足够。其"思考"能力(Thinking Capability)可以在需要时进行更深层的推理,适合语法规则的深层解释。

4.4 Python环境配置

# 安装依赖
# pip install openai
# 建议使用 Python 3.9+

from openai import OpenAI

# 初始化客户端 —— 只需修改 base_url 和 api_key
client = OpenAI(
base_url="https://api.aigc.bar/v1", # 聚合站地址
api_key="sk-你的密钥" # 替换为你的API Key
)

# 快速测试
response = client.chat.completions.create(
model="gemini-2.5-flash-lite",
messages=[
{"role": "system", "content": "You are a helpful English tutor."},
{"role": "user", "content": "What's the difference between 'affect' and 'effect'?"}
],
temperature=0.7
)

print(response.choices[0].message.content)

5 提示词工程:英语学习场景的系统化设计

5.1 提示词工程的理论框架

提示词工程(Prompt Engineering)是指通过设计和优化输入提示来引导 LLM 产生期望输出的技术。White 等人(2023)在其提示词模式目录(Prompt Pattern Catalog)中系统性地总结了多种提示词设计模式,包括角色模式(Persona Pattern)、问答模式、认知验证模式等。这些模式为英语学习工具的提示词设计提供了结构化的方法论。

在英语学习场景中,提示词工程的核心挑战在于:如何将二语习得理论的原则转化为可执行的提示词指令。例如,Krashen 的 i+1 原则需要转化为"根据学习者水平调整输出难度"的具体指令;Swain 的输出假说需要转化为"鼓励学习者产出并给予反馈"的交互策略。

5.2 核心提示词模式与英语学习适配

根据 Wei 等人(2022)提出的思维链(Chain-of-Thought, CoT)提示技术,以及 White 等人(2023)的提示词模式目录,我们可以为英语学习场景设计以下核心提示词模式:

角色模式(Persona Pattern):赋予模型一个明确的角色身份,使其输出风格和专业度与角色匹配。在英语学习中,常用的角色包括:英语教师、语伴、雅思考官等。

少样本模式(Few-Shot Pattern):在提示词中提供若干示例,引导模型理解期望的输入-输出格式。这对于语法纠错、写作批改等结构化任务尤为重要。

思维链模式(Chain-of-Thought Pattern):要求模型展示推理过程,而非直接给出答案。在语法讲解中,这体现为"先分析句子结构,再指出错误,最后给出修改建议"的步骤化输出。

迭代优化模式(Iterative Refinement Pattern):引导模型对初始输出进行自我审视和改进。在写作辅导中,模型可以先给出初稿建议,再自我评估并优化。

提示词模式理论依据英语学习应用示例场景
角色模式 社会文化理论 设定教师/语伴角色 日常对话练习
少样本模式 示例学习理论 提供纠错示例 语法纠错训练
思维链模式 元认知理论 步骤化语法分析 语法规则讲解
迭代优化模式 过程写作理论 多轮写作改进 作文批改润色
Socratic模式 苏格拉底教学法 引导式提问 词汇深度学习

5.3 英语学习核心提示词模板

以下是经过实践验证的高质量提示词模板,可直接用于 AI 英语学习工具:

词汇学习提示词:

You are an expert English vocabulary tutor. When I give you an English word, please:
1. Provide the phonetic transcription (IPA)
2. List the top 3 most common meanings with example sentences
3. Identify common collocations (at least 3)
4. Point out easily confused words and explain the differences
5. Suggest 2-3 memory techniques (etymology, association, etc.)
6. Generate a short paragraph using the word in context

Adjust your explanation to CEFR {level} level. Use simple English for lower levels.

语法纠错提示词:

You are a patient English grammar tutor. I will write sentences in English. For each sentence:
1. If correct, confirm and explain WHY it is correct (the grammar rule)
2. If incorrect, follow this process:
a. Identify the specific error type (tense, article, preposition, etc.)
b. Explain the grammar rule that was violated
c. Provide the corrected version
d. Give 2 more examples of the same grammar point
3. Rate the overall grammatical accuracy on a scale of 1-10

Do NOT rewrite the entire sentence unless necessary. Focus on the specific error.

口语对话提示词:

You are my English conversation partner. Let's have a natural conversation about {topic}.
Rules:
– Keep your responses conversational and natural
– Use vocabulary appropriate for CEFR {level} level
– If I make a noticeable error, gently correct it in parentheses after your response
– Ask follow-up questions to keep the conversation going
– Occasionally introduce a new useful expression or idiom related to the topic
– If I use Chinese, respond in English but acknowledge what I said

写作批改提示词:

You are an expert English writing evaluator. I will provide an English essay. Please evaluate it on:
1. Task Achievement (does it address the prompt?)
2. Coherence and Cohesion (logical flow and linking)
3. Lexical Resource (vocabulary range and accuracy)
4. Grammatical Range and Accuracy

For each criterion:
– Give a score out of 9 (IELTS band scale)
– Provide specific examples from my text
– Suggest concrete improvements

Then provide a revised version of the essay with improvements highlighted.

#mermaid-svg-lLGihaseTr6hri8g{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-lLGihaseTr6hri8g .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-lLGihaseTr6hri8g .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-lLGihaseTr6hri8g .error-icon{fill:#552222;}#mermaid-svg-lLGihaseTr6hri8g .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-lLGihaseTr6hri8g .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-lLGihaseTr6hri8g .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-lLGihaseTr6hri8g .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-lLGihaseTr6hri8g .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-lLGihaseTr6hri8g .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-lLGihaseTr6hri8g .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-lLGihaseTr6hri8g .marker{fill:#333333;stroke:#333333;}#mermaid-svg-lLGihaseTr6hri8g .marker.cross{stroke:#333333;}#mermaid-svg-lLGihaseTr6hri8g svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-lLGihaseTr6hri8g p{margin:0;}#mermaid-svg-lLGihaseTr6hri8g .edge{stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .section–1 rect,#mermaid-svg-lLGihaseTr6hri8g .section–1 path,#mermaid-svg-lLGihaseTr6hri8g .section–1 circle,#mermaid-svg-lLGihaseTr6hri8g .section–1 polygon,#mermaid-svg-lLGihaseTr6hri8g .section–1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section–1 text{fill:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .node-icon–1{font-size:40px;color:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .section-edge–1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth–1{stroke-width:17;}#mermaid-svg-lLGihaseTr6hri8g .section–1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-0 rect,#mermaid-svg-lLGihaseTr6hri8g .section-0 path,#mermaid-svg-lLGihaseTr6hri8g .section-0 circle,#mermaid-svg-lLGihaseTr6hri8g .section-0 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-lLGihaseTr6hri8g .section-0 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-0{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-0{stroke-width:14;}#mermaid-svg-lLGihaseTr6hri8g .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-1 rect,#mermaid-svg-lLGihaseTr6hri8g .section-1 path,#mermaid-svg-lLGihaseTr6hri8g .section-1 circle,#mermaid-svg-lLGihaseTr6hri8g .section-1 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-1 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-1{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-1{stroke-width:11;}#mermaid-svg-lLGihaseTr6hri8g .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-2 rect,#mermaid-svg-lLGihaseTr6hri8g .section-2 path,#mermaid-svg-lLGihaseTr6hri8g .section-2 circle,#mermaid-svg-lLGihaseTr6hri8g .section-2 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-2 text{fill:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-2{stroke-width:8;}#mermaid-svg-lLGihaseTr6hri8g .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-3 rect,#mermaid-svg-lLGihaseTr6hri8g .section-3 path,#mermaid-svg-lLGihaseTr6hri8g .section-3 circle,#mermaid-svg-lLGihaseTr6hri8g .section-3 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-3 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-3{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-3{stroke-width:5;}#mermaid-svg-lLGihaseTr6hri8g .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-4 rect,#mermaid-svg-lLGihaseTr6hri8g .section-4 path,#mermaid-svg-lLGihaseTr6hri8g .section-4 circle,#mermaid-svg-lLGihaseTr6hri8g .section-4 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-4 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-4{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-4{stroke-width:2;}#mermaid-svg-lLGihaseTr6hri8g .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-5 rect,#mermaid-svg-lLGihaseTr6hri8g .section-5 path,#mermaid-svg-lLGihaseTr6hri8g .section-5 circle,#mermaid-svg-lLGihaseTr6hri8g .section-5 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-5 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-5{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-5{stroke-width:-1;}#mermaid-svg-lLGihaseTr6hri8g .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-6 rect,#mermaid-svg-lLGihaseTr6hri8g .section-6 path,#mermaid-svg-lLGihaseTr6hri8g .section-6 circle,#mermaid-svg-lLGihaseTr6hri8g .section-6 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-6 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-6{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-6{stroke-width:-4;}#mermaid-svg-lLGihaseTr6hri8g .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-7 rect,#mermaid-svg-lLGihaseTr6hri8g .section-7 path,#mermaid-svg-lLGihaseTr6hri8g .section-7 circle,#mermaid-svg-lLGihaseTr6hri8g .section-7 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-7 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-7{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-7{stroke-width:-7;}#mermaid-svg-lLGihaseTr6hri8g .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-8 rect,#mermaid-svg-lLGihaseTr6hri8g .section-8 path,#mermaid-svg-lLGihaseTr6hri8g .section-8 circle,#mermaid-svg-lLGihaseTr6hri8g .section-8 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-8 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-8{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-8{stroke-width:-10;}#mermaid-svg-lLGihaseTr6hri8g .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-9 rect,#mermaid-svg-lLGihaseTr6hri8g .section-9 path,#mermaid-svg-lLGihaseTr6hri8g .section-9 circle,#mermaid-svg-lLGihaseTr6hri8g .section-9 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-9 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-9{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-9{stroke-width:-13;}#mermaid-svg-lLGihaseTr6hri8g .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-10 rect,#mermaid-svg-lLGihaseTr6hri8g .section-10 path,#mermaid-svg-lLGihaseTr6hri8g .section-10 circle,#mermaid-svg-lLGihaseTr6hri8g .section-10 polygon,#mermaid-svg-lLGihaseTr6hri8g .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-10 text{fill:black;}#mermaid-svg-lLGihaseTr6hri8g .node-icon-10{font-size:40px;color:black;}#mermaid-svg-lLGihaseTr6hri8g .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .edge-depth-10{stroke-width:-16;}#mermaid-svg-lLGihaseTr6hri8g .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-lLGihaseTr6hri8g .disabled,#mermaid-svg-lLGihaseTr6hri8g .disabled circle,#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:lightgray;}#mermaid-svg-lLGihaseTr6hri8g .disabled text{fill:#efefef;}#mermaid-svg-lLGihaseTr6hri8g .section-root rect,#mermaid-svg-lLGihaseTr6hri8g .section-root path,#mermaid-svg-lLGihaseTr6hri8g .section-root circle,#mermaid-svg-lLGihaseTr6hri8g .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-lLGihaseTr6hri8g .section-root text{fill:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .section-root span{color:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .section-2 span{color:#ffffff;}#mermaid-svg-lLGihaseTr6hri8g .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-lLGihaseTr6hri8g .edge{fill:none;}#mermaid-svg-lLGihaseTr6hri8g .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-lLGihaseTr6hri8g :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

提示词工程

基础模式

零样本提示

少样本提示

角色设定

高级模式

思维链CoT

自我一致性

迭代优化

英语学习适配

词汇学习

音标释义

搭配记忆

易混辨析

语法纠错

错误定位

规则讲解

举一反三

口语对话

情景模拟

即时纠错

表达拓展

写作批改

多维评分

具体建议

范文对比

6 Python版AI英语学习工具完整实现

6.1 整体架构设计

本节将实现一个功能完整的 Python 版 AI 英语学习工具,包含词汇学习、语法纠错、口语对话和写作批改四大模块。整体架构如下:

#mermaid-svg-kn2ntGuaUGrEmgdd{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-kn2ntGuaUGrEmgdd .error-icon{fill:#552222;}#mermaid-svg-kn2ntGuaUGrEmgdd .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-kn2ntGuaUGrEmgdd .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-kn2ntGuaUGrEmgdd .marker{fill:#333333;stroke:#333333;}#mermaid-svg-kn2ntGuaUGrEmgdd .marker.cross{stroke:#333333;}#mermaid-svg-kn2ntGuaUGrEmgdd svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-kn2ntGuaUGrEmgdd p{margin:0;}#mermaid-svg-kn2ntGuaUGrEmgdd .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster-label text{fill:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster-label span{color:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster-label span p{background-color:transparent;}#mermaid-svg-kn2ntGuaUGrEmgdd .label text,#mermaid-svg-kn2ntGuaUGrEmgdd span{fill:#333;color:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd .node rect,#mermaid-svg-kn2ntGuaUGrEmgdd .node circle,#mermaid-svg-kn2ntGuaUGrEmgdd .node ellipse,#mermaid-svg-kn2ntGuaUGrEmgdd .node polygon,#mermaid-svg-kn2ntGuaUGrEmgdd .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-kn2ntGuaUGrEmgdd .rough-node .label text,#mermaid-svg-kn2ntGuaUGrEmgdd .node .label text,#mermaid-svg-kn2ntGuaUGrEmgdd .image-shape .label,#mermaid-svg-kn2ntGuaUGrEmgdd .icon-shape .label{text-anchor:middle;}#mermaid-svg-kn2ntGuaUGrEmgdd .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-kn2ntGuaUGrEmgdd .rough-node .label,#mermaid-svg-kn2ntGuaUGrEmgdd .node .label,#mermaid-svg-kn2ntGuaUGrEmgdd .image-shape .label,#mermaid-svg-kn2ntGuaUGrEmgdd .icon-shape .label{text-align:center;}#mermaid-svg-kn2ntGuaUGrEmgdd .node.clickable{cursor:pointer;}#mermaid-svg-kn2ntGuaUGrEmgdd .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-kn2ntGuaUGrEmgdd .arrowheadPath{fill:#333333;}#mermaid-svg-kn2ntGuaUGrEmgdd .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-kn2ntGuaUGrEmgdd .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-kn2ntGuaUGrEmgdd .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-kn2ntGuaUGrEmgdd .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-kn2ntGuaUGrEmgdd .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-kn2ntGuaUGrEmgdd .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster text{fill:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd .cluster span{color:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-kn2ntGuaUGrEmgdd .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-kn2ntGuaUGrEmgdd rect.text{fill:none;stroke-width:0;}#mermaid-svg-kn2ntGuaUGrEmgdd .icon-shape,#mermaid-svg-kn2ntGuaUGrEmgdd .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-kn2ntGuaUGrEmgdd .icon-shape p,#mermaid-svg-kn2ntGuaUGrEmgdd .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-kn2ntGuaUGrEmgdd .icon-shape rect,#mermaid-svg-kn2ntGuaUGrEmgdd .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-kn2ntGuaUGrEmgdd .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-kn2ntGuaUGrEmgdd .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-kn2ntGuaUGrEmgdd :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

API聚合站

API调用层

业务逻辑层

用户交互层

命令行界面

词汇模块

语法模块

对话模块

写作模块

OpenAI SDK

会话管理

提示词模板

api.aigc.bar

6.2 核心代码实现

以下是完整的 Python 实现,代码在 Windows/Linux/macOS 均可运行:

"""
AI英语学习工具 – 基于API聚合站的完整实现
模型: gemini-2.5-flash-lite (免费)
API站: https://api.aigc.bar/register?aff=UP4F
"""

import json
import os
from openai import OpenAI

# ============ 配置区 ============
BASE_URL = "https://api.aigc.bar/v1"
API_KEY = os.environ.get("AIGC_API_KEY", "sk-你的密钥") # 建议用环境变量
MODEL = "gemini-2.5-flash-lite" # 免费模型,非常适合英语学习

# ============ 初始化客户端 ============
client = OpenAI(base_url=BASE_URL, api_key=API_KEY)

# ============ 提示词模板 ============
SYSTEM_PROMPTS = {
"vocab": (
"You are an expert English vocabulary tutor. When I give you an English word, "
"please provide: 1) IPA phonetic transcription, 2) Top 3 meanings with example "
"sentences, 3) Common collocations (at least 3), 4) Easily confused words and "
"differences, 5) Memory techniques (etymology, association), 6) A short paragraph "
"using the word in context. Adjust to CEFR {level} level."
),
"grammar": (
"You are a patient English grammar tutor. For each sentence I write: "
"1) If correct, confirm and explain the grammar rule. "
"2) If incorrect: a) Identify error type, b) Explain the violated rule, "
"c) Provide correction, d) Give 2 more examples. "
"3) Rate grammatical accuracy 1-10. Focus on specific errors."
),
"chat": (
"You are my English conversation partner. Rules: "
"- Keep responses conversational and natural. "
"- Use vocabulary for CEFR {level} level. "
"- If I make an error, gently correct it in parentheses. "
"- Ask follow-up questions to continue. "
"- Occasionally introduce useful expressions/idioms. "
"- If I use Chinese, respond in English but acknowledge."
),
"writing": (
"You are an expert English writing evaluator. Evaluate on: "
"1) Task Achievement, 2) Coherence & Cohesion, "
"3) Lexical Resource, 4) Grammatical Range & Accuracy. "
"For each: score /9 (IELTS band), give specific examples, "
"suggest improvements. Then provide a revised version."
),
}

def call_api(system_prompt: str, user_message: str,
history: list = None, temperature: float = 0.7) > str:
"""调用API聚合站的统一接口"""
messages = [{"role": "system", "content": system_prompt}]
if history:
messages.extend(history)
messages.append({"role": "user", "content": user_message})

try:
response = client.chat.completions.create(
model=MODEL,
messages=messages,
temperature=temperature,
max_tokens=2048
)
return response.choices[0].message.content
except Exception as e:
return f"[API调用错误] {e}"

def vocab_learn(word: str, level: str = "B1") > str:
"""词汇学习模块"""
prompt = SYSTEM_PROMPTS["vocab"].format(level=level)
return call_api(prompt, f"Please teach me the word: {word}", temperature=0.5)

def grammar_check(sentence: str) > str:
"""语法纠错模块"""
return call_api(SYSTEM_PROMPTS["grammar"], sentence, temperature=0.3)

def chat_practice(topic: str = "daily life", level: str = "B1"):
"""口语对话模块 – 多轮交互"""
prompt = SYSTEM_PROMPTS["chat"].format(level=level)
history = []
print(f"\\n{'='*50}")
print(f" 英语对话练习 | 话题: {topic} | 级别: {level}")
print(f" 输入 'quit' 退出, 'topic:xxx' 换话题")
print(f"{'='*50}\\n")

# 开启对话
first_msg = f"Hi! Let's talk about {topic}. Please start the conversation."
reply = call_api(prompt, first_msg, history)
history.append({"role": "user", "content": first_msg})
history.append({"role": "assistant", "content": reply})
print(f"Partner: {reply}\\n")

while True:
user_input = input("You: ").strip()
if user_input.lower() == "quit":
print("Goodbye! Keep practicing!")
break
if user_input.startswith("topic:"):
topic = user_input[6:].strip()
history = []
first_msg = f"Let's switch to talking about {topic}."
reply = call_api(prompt, first_msg, history)
history.append({"role": "user", "content": first_msg})
history.append({"role": "assistant", "content": reply})
print(f"\\nPartner: {reply}\\n")
continue
if not user_input:
continue

reply = call_api(prompt, user_input, history)
history.append({"role": "user", "content": user_input})
history.append({"role": "assistant", "content": reply})
print(f"\\nPartner: {reply}\\n")

def writing_evaluate(essay: str) > str:
"""写作批改模块"""
return call_api(SYSTEM_PROMPTS["writing"], essay, temperature=0.4)

def save_conversation(history: list, filename: str = "conversation_log.json"):
"""保存对话记录"""
with open(filename, "w", encoding="utf-8") as f:
json.dump(history, f, ensure_ascii=False, indent=2)
print(f"对话已保存至 {filename}")

# ============ 主菜单 ============
def main():
print("""
╔══════════════════════════════════════════════╗
║ AI 英语学习工具 v1.0 ║
║ 模型: gemini-2.5-flash-lite (免费) ║
║ API: api.aigc.bar ║
╠══════════════════════════════════════════════╣
║ 1. 词汇学习 (输入单词深入学习) ║
║ 2. 语法纠错 (输入句子检查语法) ║
║ 3. 口语对话 (多轮情景对话练习) ║
║ 4. 写作批改 (提交作文获取评分) ║
║ 0. 退出 ║
╚══════════════════════════════════════════════╝
"""
)

while True:
choice = input("请选择功能 [0-4]: ").strip()

if choice == "1":
word = input("输入要学习的英语单词: ").strip()
level = input("选择级别(A1/A2/B1/B2/C1/C2, 默认B1): ").strip() or "B1"
result = vocab_learn(word, level)
print(f"\\n{result}\\n")

elif choice == "2":
sentence = input("输入英语句子: ").strip()
result = grammar_check(sentence)
print(f"\\n{result}\\n")

elif choice == "3":
topic = input("选择话题(默认daily life): ").strip() or "daily life"
level = input("选择级别(默认B1): ").strip() or "B1"
chat_practice(topic, level)

elif choice == "4":
print("请输入/粘贴你的英语作文(输入END结束):")
lines = []
while True:
line = input()
if line.strip() == "END":
break
lines.append(line)
essay = "\\n".join(lines)
result = writing_evaluate(essay)
print(f"\\n{result}\\n")

elif choice == "0":
print("感谢使用,坚持学习!")
break
else:
print("无效选择,请重新输入。")

if __name__ == "__main__":
main()

6.3 运行与测试

将上述代码保存为 ai_english_tutor.py,然后执行:

# 设置API Key(推荐方式)
export AIGC_API_KEY="sk-你的密钥"

# 运行
python ai_english_tutor.py

运行后会出现交互式菜单,支持词汇查询、语法纠错、口语对话和写作批改四种功能。对话模块支持多轮上下文,模型会记住之前的对话内容。所有模块均使用免费的 gemini-2.5-flash-lite 模型,无需任何费用。

7 HTML版AI英语学习工具搭建指南

7.1 纯前端方案的架构考量

对于不熟悉 Python 的用户,HTML 版本提供了更低门槛的替代方案。但需要注意一个关键的安全问题:API Key 不应暴露在前端代码中。本方案提供两种实现策略:简单版(直接调用,适合个人学习使用)和安全版(通过简单后端代理转发请求)。

简单版直接在浏览器中调用 API 聚合站接口,优点是零部署、即开即用,缺点是 API Key 会暴露在浏览器中。安全版通过一个轻量级的 Python Flask 后端代理请求,API Key 仅存储在服务端。

7.2 简单版HTML实现

以下是完整的单文件 HTML 实现,保存为 .html 文件后直接用浏览器打开即可使用:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI英语学习助手</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh; display: flex; justify-content: center;
align-items: center; padding: 20px;
}
.container {
background: white; border-radius: 16px; width: 100%; max-width: 800px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden;
}
.header {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
padding: 20px 30px; color: white;
}
.header h1 { font-size: 22px; margin-bottom: 5px; }
.header p { font-size: 13px; opacity: 0.9; }
.config {
padding: 15px 30px; background: #f8f9fa;
border-bottom: 1px solid #eee; display: flex; gap: 10px;
flex-wrap: wrap; align-items: center;
}
.config label { font-size: 13px; font-weight: 600; color: #555; }
.config input, .config select {
padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px;
font-size: 13px; outline: none;
}
.config input:focus, .config select:focus {
border-color: #4facfe;
}
.tabs {
display: flex; border-bottom: 2px solid #eee;
}
.tab {
flex: 1; padding: 12px; text-align: center; cursor: pointer;
font-size: 14px; font-weight: 600; color: #888;
transition: all 0.3s; border-bottom: 3px solid transparent;
}
.tab.active { color: #4facfe; border-bottom-color: #4facfe; }
.tab:hover { background: #f0f8ff; }
.chat-area {
height: 400px; overflow-y: auto; padding: 20px 30px;
background: #fafbfc;
}
.message {
margin-bottom: 15px; display: flex; gap: 10px;
}
.message.user { flex-direction: row-reverse; }
.avatar {
width: 36px; height: 36px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 16px; flex-shrink: 0;
}
.message.assistant .avatar { background: #e3f2fd; }
.message.user .avatar { background: #fff3e0; }
.bubble {
max-width: 70%; padding: 12px 16px; border-radius: 12px;
font-size: 14px; line-height: 1.6; white-space: pre-wrap;
}
.message.assistant .bubble {
background: white; border: 1px solid #e8e8e8;
}
.message.user .bubble {
background: #4facfe; color: white;
}
.input-area {
padding: 15px 30px; border-top: 1px solid #eee;
display: flex; gap: 10px;
}
.input-area textarea {
flex: 1; padding: 10px 14px; border: 1px solid #ddd;
border-radius: 10px; font-size: 14px; resize: none;
height: 44px; outline: none; font-family: inherit;
}
.input-area textarea:focus { border-color: #4facfe; }
.input-area button {
padding: 10px 24px; background: linear-gradient(135deg, #4facfe, #00f2fe);
color: white; border: none; border-radius: 10px; font-size: 14px;
font-weight: 600; cursor: pointer; transition: opacity 0.3s;
}
.input-area button:hover { opacity: 0.85; }
.input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
.loading { text-align: center; color: #999; padding: 10px; font-size: 13px; }
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>AI 英语学习助手</h1>
<p>模型: gemini-2.5-flash-lite | Powered by api.aigc.bar</p>
</div>
<div class="config">
<label>API Key:</label>
<input type="password" id="apiKey" placeholder="sk-你的密钥" style="width:200px">
<label>级别:</label>
<select id="level">
<option value="A1">A1 入门</option>
<option value="A2">A2 初级</option>
<option value="B1" selected>B1 中级</option>
<option value="B2">B2 中高级</option>
<option value="C1">C1 高级</option>
</select>
</div>
<div class="tabs">
<div class="tab active" data-mode="vocab">词汇学习</div>
<div class="tab" data-mode="grammar">语法纠错</div>
<div class="tab" data-mode="chat">口语对话</div>
<div class="tab" data-mode="writing">写作批改</div>
</div>
<div class="chat-area" id="chatArea"></div>
<div class="input-area">
<textarea id="userInput" placeholder="输入单词、句子或作文内容…"></textarea>
<button id="sendBtn" onclick="sendMessage()">发送</button>
</div>
</div>

<script>
const BASE_URL = "https://api.aigc.bar/v1";
const MODEL = "gemini-2.5-flash-lite";

const PROMPTS = {
vocab: (level) => `You are an expert English vocabulary tutor. When given a word, provide: 1) IPA, 2) Top 3 meanings with examples, 3) Collocations, 4) Confused words, 5) Memory tips, 6) Context paragraph. CEFR ${level} level.`,
grammar: () => `You are a patient English grammar tutor. For each sentence: if correct, explain the rule; if incorrect, identify error type, explain rule, correct it, give 2 examples. Rate 1-10.`,
chat: (level) => `You are my English conversation partner. Be natural, use ${level} vocabulary. Correct my errors in parentheses. Ask follow-ups. Introduce useful expressions.`,
writing: () => `You are an expert English writing evaluator. Evaluate: Task Achievement, Coherence, Lexical Resource, Grammar. Score each /9 (IELTS). Give examples and suggestions. Provide revised version.`
};

let currentMode = "vocab";
let chatHistory = [];

// 切换标签
document.querySelectorAll(".tab").forEach(tab => {
tab.addEventListener("click", () => {
document.querySelectorAll(".tab").forEach(t => t.classList.remove("active"));
tab.classList.add("active");
currentMode = tab.dataset.mode;
chatHistory = [];
document.getElementById("chatArea").innerHTML = "";
});
});

// 回车发送
document.getElementById("userInput").addEventListener("keydown", (e) => {
if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); sendMessage(); }
});

function addMessage(role, content) {
const area = document.getElementById("chatArea");
const div = document.createElement("div");
div.className = `message ${role}`;
const avatar = document.createElement("div");
avatar.className = "avatar";
avatar.textContent = role === "user" ? "我" : "AI";
const bubble = document.createElement("div");
bubble.className = "bubble";
bubble.textContent = content;
div.appendChild(avatar);
div.appendChild(bubble);
area.appendChild(div);
area.scrollTop = area.scrollHeight;
}

async function sendMessage() {
const input = document.getElementById("userInput");
const apiKey = document.getElementById("apiKey").value.trim();
const level = document.getElementById("level").value;
const text = input.value.trim();

if (!text) return;
if (!apiKey) { alert("请先输入API Key"); return; }

addMessage("user", text);
input.value = "";

const btn = document.getElementById("sendBtn");
btn.disabled = true;
btn.textContent = "思考中…";

const systemPrompt = PROMPTS[currentMode](level);
const messages = [{ role: "system", content: systemPrompt }];

if (currentMode === "chat") {
chatHistory.push({ role: "user", content: text });
messages.push(chatHistory.slice(10)); // 保留最近10轮
} else {
messages.push({ role: "user", content: text });
}

try {
const response = await fetch(`${BASE_URL}/chat/completions`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`
},
body: JSON.stringify({
model: MODEL,
messages: messages,
temperature: currentMode === "chat" ? 0.8 : 0.5,
max_tokens: 2048
})
});

const data = await response.json();
const reply = data.choices?.[0]?.message?.content || "抱歉,未获取到回复";
addMessage("assistant", reply);

if (currentMode === "chat") {
chatHistory.push({ role: "assistant", content: reply });
}
} catch (err) {
addMessage("assistant", `[错误] ${err.message}`);
}

btn.disabled = false;
btn.textContent = "发送";
}
</script>
</body>
</html>

7.3 安全版:添加Python后端代理

对于需要保护 API Key 的场景,可以添加一个简单的 Flask 后端:

"""
安全版后端代理 – 保护API Key不暴露在前端
pip install flask flask-cors
"""

from flask import Flask, request, jsonify
from flask_cors import CORS
from openai import OpenAI

app = Flask(__name__)
CORS(app)

# API Key存储在服务端,前端无法获取
client = OpenAI(
base_url="https://api.aigc.bar/v1",
api_key="sk-你的密钥" # 仅服务端可见
)

SYSTEM_PROMPTS = {
"vocab": "You are an expert English vocabulary tutor…",
"grammar": "You are a patient English grammar tutor…",
"chat": "You are my English conversation partner…",
"writing": "You are an expert English writing evaluator…"
}

@app.route("/api/chat", methods=["POST"])
def chat():
data = request.json
mode = data.get("mode", "chat")
messages = data.get("messages", [])

system_msg = {"role": "system", "content": SYSTEM_PROMPTS.get(mode, "")}
all_messages = [system_msg] + messages

try:
response = client.chat.completions.create(
model="gemini-2.5-flash-lite",
messages=all_messages,
temperature=0.7,
max_tokens=2048
)
return jsonify({
"reply": response.choices[0].message.content,
"model": response.model,
"usage": {"prompt_tokens": response.usage.prompt_tokens,
"completion_tokens": response.usage.completion_tokens}
})
except Exception as e:
return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)

前端只需将 fetch 请求地址改为 http://localhost:5000/api/chat,并移除 API Key 输入框即可。

7.4 部署与使用流程

方案优点缺点适用场景
简单版HTML 零部署,双击即用 API Key暴露 个人学习、快速体验
安全版(HTML+Flask) Key安全,可多人使用 需部署后端 小团队、教学场景
Python CLI版 功能完整,可扩展 需Python环境 深度用户、开发者

#mermaid-svg-7fcAdAqWiAfX5Rcp{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-7fcAdAqWiAfX5Rcp .error-icon{fill:#552222;}#mermaid-svg-7fcAdAqWiAfX5Rcp .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-7fcAdAqWiAfX5Rcp .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-7fcAdAqWiAfX5Rcp .marker{fill:#333333;stroke:#333333;}#mermaid-svg-7fcAdAqWiAfX5Rcp .marker.cross{stroke:#333333;}#mermaid-svg-7fcAdAqWiAfX5Rcp svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-7fcAdAqWiAfX5Rcp p{margin:0;}#mermaid-svg-7fcAdAqWiAfX5Rcp .pieCircle{stroke:#000000;stroke-width:2px;opacity:0.7;}#mermaid-svg-7fcAdAqWiAfX5Rcp .pieOuterCircle{stroke:#000000;stroke-width:1px;fill:none;}#mermaid-svg-7fcAdAqWiAfX5Rcp .pieTitleText{text-anchor:middle;font-size:25px;fill:#000000;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-7fcAdAqWiAfX5Rcp .slice{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;fill:#000000;font-size:17px;}#mermaid-svg-7fcAdAqWiAfX5Rcp .legend text{fill:#000000;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:17px;}#mermaid-svg-7fcAdAqWiAfX5Rcp :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

40%

35%

25%

英语学习工具部署方案选择

简单版HTML

安全版HTML+Flask

Python CLI版

8 效果评估、局限性与未来展望

8.1 AI英语学习工具的效果评估框架

评估 AI 英语学习工具的有效性,需要建立多维度的评估框架。参照 CALL 领域的研究传统,我们可以从以下维度进行评估:

语言学维度:考察工具在词汇教学准确性、语法纠错精确度、语用建议恰当性等方面的表现。具体指标包括:语法纠错的精确率(Precision)和召回率(Recall)、词汇释义的准确率、写作评分与人工评分的相关性等。这些指标可以形式化表示为:

Precision

=

正确纠错

所有纠错

,

Recall

=

正确纠错

实际错误

\\text{Precision} = \\frac{|\\text{正确纠错}|}{|\\text{所有纠错}|}, \\quad \\text{Recall} = \\frac{|\\text{正确纠错}|}{|\\text{实际错误}|}

Precision=所有纠错正确纠错,Recall=实际错误正确纠错

教育学维度:考察工具是否遵循二语习得理论的原则,包括输入的可理解性、输出的推动性、交互的协商性等。这一维度的评估更多依赖质性研究方法,如学习者的反思日志、使用体验访谈等。

技术维度:考察工具的响应延迟、系统稳定性、上下文记忆长度等技术指标。对于英语学习场景,响应延迟尤为重要——研究表明,超过 3 秒的等待时间会显著降低学习者的交互意愿。

用户体验维度:考察工具的易用性、学习动机激发能力、持续使用意愿等。这一维度与 Krashen 的情感过滤假设直接相关——良好的用户体验能够降低学习者的情感过滤器,促进语言习得。

8.2 当前局限性

尽管基于 LLM 的英语学习工具展现出巨大潜力,但仍存在若干不容忽视的局限性:

幻觉问题(Hallucination):LLM 可能生成看似合理但实际错误的语言学解释。例如,模型可能编造不存在的词源解释,或给出错误的语法规则。这在语法讲解和词汇教学中尤其危险,因为学习者往往无法辨别真伪。缓解策略包括:交叉验证关键信息、设置置信度阈值、在提示词中明确要求"不确定时声明不确定"。

缺乏系统性课程设计:当前工具主要依赖学习者的自主提问,缺乏结构化的课程体系。学习者可能陷入"只练习自己擅长的话题"的舒适区,无法获得全面的语言训练。未来的改进方向是引入课程图谱(Curriculum Graph),将 CEFR 框架的各级别要求映射为结构化的学习路径。

文化语境的缺失:语言学习不仅是语法和词汇的习得,更包含文化语境的理解。LLM 虽然具备一定的文化知识,但在处理文化细微差异(如英式英语与美式英语的语用差异)时仍可能不够精确。

评估的客观性:LLM 的写作评分与人工评分之间的一致性仍有提升空间。研究表明,LLM 在词汇和语法维度的评分与人工评分相关性较高,但在任务完成度和连贯性维度的评分偏差较大。

8.3 未来展望

随着 LLM 技术的持续演进和 API 生态的不断完善,AI 英语学习工具的发展前景广阔。以下几个方向值得重点关注:

多模态融合:Gemini 系列模型原生支持图片、音频和视频输入,未来的英语学习工具可以整合语音识别(用于发音评估)、图像理解(用于情景教学)等多模态能力,实现更接近真实语境的学习体验。

自适应学习:基于学习者的交互数据,构建学习者画像(Learner Profile),动态调整教学内容和难度。这需要将 LLM 与知识追踪(Knowledge Tracing)技术相结合,实现真正的个性化学习路径。

协作式学习:利用 LLM 的角色扮演能力,构建多人协作式学习场景。例如,模拟商务会议、学术讨论等真实场景,让学习者在社交互动中习得语言。

低代码/无代码平台:随着 API 聚合站的普及和前端技术的简化,未来英语教师(而非程序员)也能轻松搭建定制化的 AI 学习工具,这将极大地推动 CALL 的民主化进程。

#mermaid-svg-2phAcoWvSRPIRUWM{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-2phAcoWvSRPIRUWM .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-2phAcoWvSRPIRUWM .error-icon{fill:#552222;}#mermaid-svg-2phAcoWvSRPIRUWM .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2phAcoWvSRPIRUWM .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2phAcoWvSRPIRUWM .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2phAcoWvSRPIRUWM .marker.cross{stroke:#333333;}#mermaid-svg-2phAcoWvSRPIRUWM svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2phAcoWvSRPIRUWM p{margin:0;}#mermaid-svg-2phAcoWvSRPIRUWM .edge{stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .section–1 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section–1 path,#mermaid-svg-2phAcoWvSRPIRUWM .section–1 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section–1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section–1 text{fill:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon–1{font-size:40px;color:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge–1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth–1{stroke-width:17;}#mermaid-svg-2phAcoWvSRPIRUWM .section–1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-0 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-0 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-0 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-0 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-0{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-0{stroke-width:14;}#mermaid-svg-2phAcoWvSRPIRUWM .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-1 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-1 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-1 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-1 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-1{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-1{stroke-width:11;}#mermaid-svg-2phAcoWvSRPIRUWM .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-2 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-2 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-2 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-2 text{fill:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-2{stroke-width:8;}#mermaid-svg-2phAcoWvSRPIRUWM .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-3 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-3 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-3 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-3 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-3{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-3{stroke-width:5;}#mermaid-svg-2phAcoWvSRPIRUWM .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-4 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-4 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-4 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-4 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-4{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-4{stroke-width:2;}#mermaid-svg-2phAcoWvSRPIRUWM .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-5 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-5 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-5 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-5 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-5{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-5{stroke-width:-1;}#mermaid-svg-2phAcoWvSRPIRUWM .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-6 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-6 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-6 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-6 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-6{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-6{stroke-width:-4;}#mermaid-svg-2phAcoWvSRPIRUWM .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-7 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-7 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-7 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-7 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-7{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-7{stroke-width:-7;}#mermaid-svg-2phAcoWvSRPIRUWM .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-8 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-8 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-8 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-8 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-8{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-8{stroke-width:-10;}#mermaid-svg-2phAcoWvSRPIRUWM .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-9 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-9 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-9 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-9 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-9{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-9{stroke-width:-13;}#mermaid-svg-2phAcoWvSRPIRUWM .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-10 rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-10 path,#mermaid-svg-2phAcoWvSRPIRUWM .section-10 circle,#mermaid-svg-2phAcoWvSRPIRUWM .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-10 text{fill:black;}#mermaid-svg-2phAcoWvSRPIRUWM .node-icon-10{font-size:40px;color:black;}#mermaid-svg-2phAcoWvSRPIRUWM .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .edge-depth-10{stroke-width:-16;}#mermaid-svg-2phAcoWvSRPIRUWM .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-2phAcoWvSRPIRUWM .lineWrapper line{stroke:black;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled,#mermaid-svg-2phAcoWvSRPIRUWM .disabled circle,#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:lightgray;}#mermaid-svg-2phAcoWvSRPIRUWM .disabled text{fill:#efefef;}#mermaid-svg-2phAcoWvSRPIRUWM .section-root rect,#mermaid-svg-2phAcoWvSRPIRUWM .section-root path,#mermaid-svg-2phAcoWvSRPIRUWM .section-root circle{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-2phAcoWvSRPIRUWM .section-root text{fill:#ffffff;}#mermaid-svg-2phAcoWvSRPIRUWM .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-2phAcoWvSRPIRUWM .edge{fill:none;}#mermaid-svg-2phAcoWvSRPIRUWM .eventWrapper{filter:brightness(120%);}#mermaid-svg-2phAcoWvSRPIRUWM :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

2024

单轮问答式工具

基础语法纠错

简单词汇查询

2025

多轮对话式工具

上下文感知对话

写作批改评分

API聚合站兴起

2026

多模态融合工具

语音发音评估

图像情景教学

自适应学习路径

未来

沉浸式AI语伴

实时翻译辅助

文化语境理解

教师低代码搭建

AI英语学习工具演进路线

参考文献

  • Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30. https://arxiv.org/abs/1706.03762

  • Wei, J., Wang, X., Schuurmans, D., et al. (2022). Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35. https://arxiv.org/abs/2201.11903

  • White, J., Fu, Q., Hopton, M., et al. (2023). A prompt pattern catalog to enhance prompt engineering with ChatGPT. arXiv preprint arXiv:2302.11382. https://arxiv.org/abs/2302.11382

  • Kuhail, M. A., Alturki, N., Alramlawi, S., & Alhejori, K. (2023). Interacting with educational chatbots: A systematic review. Education and Information Technologies, 28, 973–1018. https://doi.org/10.1007/s10639-022-11177-3

  • Huang, Y., et al. (2025). Artificial intelligence in English as a foreign language learning: A systematic review. Heliyon. https://www.sciencedirect.com/science/article/pii/S2666920X26000573

  • Zhao, W. X., Zhou, K., Li, J., et al. (2023). A survey of large language models. arXiv preprint arXiv:2303.18223. https://arxiv.org/abs/2303.18223

  • 赞(0)
    未经允许不得转载:171主机测评 » 基于大模型API聚合站构建个性化AI英语学习工具:从二语习得理论到工程实践
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址