Skip to content

Commit 83d9e5a

Browse files
committed
Update docs
1 parent e94073b commit 83d9e5a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

docs/guide/getting-started/introduction.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ AIScript isn't just a language—it's a complete web development solution:
3535

3636
```javascript
3737
$ export OPENAI_API_KEY=<your-openai-api-key>
38-
3938
$ cat web.ai
4039
get / {
41-
"""A api to ask LLM"""
40+
"""An api to ask LLM"""
4241

4342
query {
4443
"""the question to ask"""
@@ -51,7 +50,6 @@ get / {
5150
let answer = prompt question;
5251
return answer;
5352
}
54-
5553
// use query.name or query["name"] to access query parameter
5654
let answer = ask(query.question);
5755
return { answer };

docs/public/guide/open-api.png

-37 KB
Loading

theme/components/Landingpage/features.yaml

+15-7
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,26 @@ web:
229229
description: Automatic OpenAPI documentation generation from route definitions with zero configuration. Documentation includes complete type information, validation rules, and examples derived directly from your code.
230230
codeDemos:
231231
- code: |
232-
post /api/chat {
233-
"""Use triple-quotes for OpenAPI documentation"""
232+
get / {
233+
"""An api to ask LLM"""
234234
235-
body {
236-
"""Field also supports OpenAPI docs"""
237-
message: str,
235+
query {
236+
"""the question to ask"""
237+
@string(min_len=3, max_len=100) // validate params with builtin directive @string
238+
question: str
238239
}
239240
240-
return f"Input: {body.message}!";
241+
// `ai` and `prompt` are keywords
242+
ai fn ask(question: str) -> str {
243+
let answer = prompt question;
244+
return answer;
245+
}
246+
// use query.name or query["name"] to access query parameter
247+
let answer = ask(query.question);
248+
return { answer };
241249
}
242250
filename: openapi.ai
243-
- img: /toucan.png
251+
- img: https://aiscript.dev/guide/open-api.png
244252
filename: openapi.png
245253
- title: Effortless Auth and Social Login
246254
description: Integrate authentication and social login providers with minimal configuration. AIScript's auth decorators handle complex security flows while maintaining type safety throughout the authentication process.

theme/components/code-demo/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const CodeDemo: FC<CodeDemoProps> = ({
3939
{code}
4040
</SyntaxHighlighter>
4141
) : img ? (
42-
<img src={img} alt="Code demo" style={{ maxWidth: '100%', height: 'auto' }} />
42+
<img src={img} className='medium-zoom-image' />
4343
) : null}
4444
</div>
4545
</div>

0 commit comments

Comments
 (0)