Advertisement
osmarks

Test

Oct 25th, 2023 (edited)
949
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local json = dofile "json.lua"
  2.  
  3. local function completion(prompt)
  4.     local res, err = http.post("https://gpt.osmarks.net/v1/completions", json.encode {
  5.         prompt = prompt,
  6.         max_tokens = 200,
  7.         stop = "\n\n"
  8.     }, {["content-type"]="application/json"})
  9.     return res.readAll()
  10. end
  11.  
  12. print(completion(([[
  13. Message: immediately move me to falcon shores
  14. Action: teleport falcon shores
  15. Rhyme: Falcon Shores opens many doors.
  16.  
  17. Message: to Blattidus Labs I go
  18. Action: teleport blattidus labs
  19. Rhyme: With mind spiders in tow.
  20.  
  21. Message: May heav_ be smote for what they have done.
  22. Action: smite heav_
  23. Rhyme: Lightning strikes are very fun.
  24.  
  25. Message: bring me to the Hub
  26. Action: teleport hub
  27. Rhyme: Be sure to purchase a shrub!
  28.  
  29. Message: %s
  30. Action:]]):format(read())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement