Script Library: 1240 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Archive version of: ai-geteway.r ... version: 1 ... sergey 30-Jun

Amendment note: new script || Publicly available? Yes

REBOL [
    title: "Gateway for request to AI"
    File: %ai-geteway.r
    Date: 30-06-2024
    Version: 0.0.1
    Author: "Sergey Pochinok"
    Purpose: "A function that makes an AI request via the Internet and returns a response."
    EMail: [pochinok@bk.ru]
    History: [
        0.0.1 [30-06-2024 "Started"]
    ]
    Category: [info]
    library: [
        level: 'intermediate 
        platform: 'all
        type: 'function
        domain: [ai text text-processing internet]
        tested-under: [core & view 2.7.8.3.1 win & linux] 
        support: none
        license: 'BSD
        see-also: none
    ]
]

ai: func [ 
	"Text request to AI" 
	request [string!] "request text"
	] [ 
	return first parse/all read/custom http://pochinoksergey.ru/rebol/ai/ reduce ['post append copy "q=" request] "^(null)" ]

; simple example of using the function
print ai "Hi. Tell us about yourself and the Rebol language"
halt
Notes