Joe2EZ commited on
Commit
dde9028
1 Parent(s): 566b152

Importing free cosmos rp 8k api call function

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -1,3 +1,19 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  gr.load("models/PawanKrd/CosmosRP-8k").launch()
 
1
  import gradio as gr
2
+ import requests
3
+
4
+ url = "https://api.pawan.krd/cosmosrp/v1/chat/completions"
5
+ headers = {
6
+ "Content-Type": "application/json"
7
+ }
8
+ data = {
9
+ "model": "cosmosrp",
10
+ "messages": [
11
+ {"role": "system", "content": "You are a fantasy world dungeon master."},
12
+ {"role": "user", "content": "Describe the entrance of the ancient cave."}
13
+ ]
14
+ }
15
+
16
+ response = requests.post(url, headers=headers, json=data)
17
+ print(response.json())
18
 
19
  gr.load("models/PawanKrd/CosmosRP-8k").launch()