Skip to content

Commit 8207248

Browse files
authored
Docs/v1.4.1 (#193)
* version 1.2.1 * version 1.3.0 * version 1.4.1
1 parent ea7f544 commit 8207248

File tree

43 files changed

+1777
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1777
-6
lines changed

apps/docs/docs/features/guardian.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ export const GuardianApiName = () => {
2222
最大500文字までを受け付けています。
2323

2424
**`score_threshold`** integer optional <br/>
25-
`0-1`までの値を受け付けています。 <br />
25+
`0.1-1`までの値を受け付けています。 <br />
2626
default値は`0.5`です。
2727

28+
**`model`** string optional <br/>
29+
指定可能なモデル
30+
- gpt-4o-mini
31+
- claude-3-haiku
32+
- gemini-1.5-flash
33+
2834

2935
### リクエスト例
3036
<details>

apps/docs/docs/quick-start.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: クイックスタート
3+
---
4+
5+
## APIを試してみる
6+
APIキーを発行せずに試してみましょう。
7+
8+
1. [管理ページ](https://peeace.net)にアクセスし、`平和ネットAPIを使う`をクリックしてください。<br/><br/>
9+
![](/img/top.png)
10+
11+
2. `ログインしないで使ってみる`から簡単にAPIを試すことができます! <br/><br/>
12+
![](/img/anon-login.png)
13+
14+
3. Playgroundページで試しましょう!<br/><br/>
15+
![](/img/playground.png)

apps/docs/docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const config: Config = {
5252
lastVersion: 'current',
5353
versions: {
5454
current: {
55-
label: '1.2.1 (latest)',
55+
label: '1.4.1 (latest)',
5656
path: '/',
5757
},
5858
},

apps/docs/sidebars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const sidebars: SidebarsConfig = {
1717
{
1818
type: 'category',
1919
label: 'API 概要',
20-
link: { type: 'doc', id: 'overview' },
21-
items: ['how-to-use/basic'],
20+
link: { type: 'doc', id: 'quick-start' },
21+
items: ['quick-start','how-to-use/basic'],
2222
},
2323
{
2424
type: 'category',

apps/docs/src/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function HomepageHeader() {
1919
<div className={styles.buttons}>
2020
<Link
2121
className="button button--secondary button--lg"
22-
to="/docs/overview">
23-
Peace Net API 概要- 5min ⏱️
22+
to="/docs/quick-start">
23+
Peace Net API 概要- 3min ⏱️
2424
</Link>
2525
</div>
2626
</div>
23.8 KB
Loading
292 KB
Loading

apps/docs/static/img/top.png

45 KB
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Go
2+
3+
```go
4+
// main.go
5+
package main
6+
7+
import (
8+
"bytes"
9+
"encoding/json"
10+
"fmt"
11+
"net/http"
12+
)
13+
14+
var (
15+
apiKey = "YOUR_API_KEY"
16+
apiUrl = "https://api.peeace.net/v1/guardians/text"
17+
)
18+
19+
func main() {
20+
// リクエストを作成
21+
body, err := json.Marshal(map[string]string{
22+
"text": "最低な文章",
23+
})
24+
if err != nil {
25+
fmt.Println("Error marshalling request body:", err)
26+
return
27+
}
28+
29+
req, err := http.NewRequest("POST", apiUrl, bytes.NewBuffer(body))
30+
if err != nil {
31+
fmt.Println("Error creating request:", err)
32+
return
33+
}
34+
req.Header.Set("Content-Type", "application/json")
35+
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
36+
37+
// リクエスト
38+
client := &http.Client{}
39+
resp, err := client.Do(req)
40+
if err != nil {
41+
fmt.Println("Error sending request:", err)
42+
return
43+
}
44+
defer resp.Body.Close()
45+
46+
// レスポンスをチェック
47+
if resp.StatusCode != http.StatusOK {
48+
fmt.Println("Request failed with status:", resp.Status)
49+
return
50+
}
51+
52+
var responseBody map[string]interface{}
53+
if err := json.NewDecoder(resp.Body).Decode(&responseBody); err != nil {
54+
fmt.Println("Error decoding response body:", err)
55+
return
56+
}
57+
58+
fmt.Println("Response:", responseBody)
59+
}
60+
```
61+
62+
### 実行
63+
64+
```sh
65+
go run main.go
66+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# コードリファレンス
2+
3+
<!-- <言語名>がタイトルだと望ましい -->
4+
- [Node.js](./node-js.md)
5+
- [Go](./golang.md)

0 commit comments

Comments
 (0)