-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
112 lines (105 loc) · 3.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OpenRizz</title>
<link href="/static/style.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/python.min.js"></script>
</head>
<body class="bg-gray-200 m-8">
<!--Generate a SImple Documentation for this APplication-->
<h1 class="text-4xl">OpenRizz</h1>
<p>OpenRizz is a simple API to give you Pickup lines and Flirt lines</p>
<main>
Usage: <br>
<div class="grid md:grid-cols-2 gap-4">
<pre class="border-2 border-gray-300 bg-gray-100">
<code class="">
# curl
curl --location --request POST 'http://localhost:8000/rizz/invoke' \
--header 'Content-Type: application/json' \
--data-raw '{
"input" : {
"description":"Her name is Shreya. She looks cute and has a Heart of Gold (metaphor)!",
"response_type":"Funny, Flirty, Seductive"}
}'
</code>
</pre>
<pre class="border-2 border-gray-300 bg-gray-100">
<code class="language-python">
# Python
import requests
url = "http://localhost:8000/rizz/invoke"
payload = "{\"input\": {\"description\": \"Her name is Shreya. She looks cute and has a Heart of Gold (metaphor)!\",\"response_type\": \"Funny, Flirty, Seductive\"}}"
headers = { 'Content-Type': 'application/json' }
response = requests.request("POST", url, headers=headers, data=payload)
</code>
</pre>
<pre>
<code class="language-go">
# Go
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{
"input" : {
"description":"Her name is Shreya. She looks cute and has a Heart of Gold (metaphor)!",
"response_type":"Funny, Flirty, Seductive"}
}`)
req, err := http.NewRequest("POST", "http://localhost:8000/rizz/invoke", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
</code>
</pre>
<pre>
<code class="language-js">
# JS
fetch('http://localhost:8000/rizz/invoke', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'input': {
'description': 'Her name is Shreya. She looks cute and has a Heart of Gold (metaphor)!',
'response_type': 'Funny, Flirty, Seductive'
}
})
}); </code>
</pre>
</div>
</main>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
document.querySelectorAll('pre code').forEach((el) => {
hljs.highlightElement(el);
});
});
</script>
</body>
</html>