Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Where are the calculations that go with a calculated risk?


devel / comp.lang.prolog / ANN: Dogelog Runtime 1.6.0 (POST Requests)

SubjectAuthor
* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mostowski Collapse
+* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mostowski Collapse
|`* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mostowski Collapse
| `* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mostowski Collapse
|  `- ANN: Dogelog Runtime 1.6.0 (POST Requests)Mild Shock
`* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mild Shock
 `* ANN: Dogelog Runtime 1.6.0 (POST Requests)Mild Shock
  `- ANN: Dogelog Runtime 1.6.0 (POST Requests)Mild Shock

1
ANN: Dogelog Runtime 1.6.0 (POST Requests)

<u4d5pl$9pjm$4@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2046&group=comp.lang.prolog#2046

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: ANN: Dogelog Runtime 1.6.0 (POST Requests)
Date: Sun, 21 May 2023 15:19:50 +0200
Message-ID: <u4d5pl$9pjm$4@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 21 May 2023 13:19:50 -0000 (UTC)
Injection-Info: solani.org;
logging-data="321142"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:NhcuAAJ0ER5v0sNNkmZyNaAau1Y=
X-User-ID: eJwNycEBwCAIA8CVBCHiOAhk/xHa+55vCOoYHOZ0qj4FEfmyZi57J+5r9WaLYaQMmkuxBMYcVvw3cya04P0BeF0WgQ==
X-Mozilla-News-Host: news://news.solani.org:119
 by: Mostowski Collapse - Sun, 21 May 2023 13:19 UTC

(Sorry for multiple posts, looks like my human
post mechanism isn't working correctly)

Dear All,

We are happy to announce a new version of the former
Jekejeke runtime 1.6.0, now called Dogelog runtime.

- Script Mode: The Prolog flag argv is now supported.
The Prolog interpreter can be called in the form
"prolog text arg1 .. argn". The "text" file is then
automatically consulted and "arg1 .. argn" ends up
in argv as a list of prolog atoms. Furthermore,
there is now the directive initialization/1. Both
features are also available in Dogelog Player.

- POST Requests: The open/[3,4] predicates have long
been able to understand the http: and https: protocol.
The new options method/1, headers/1 and body/1 are
self-explanatory. The options are also available in
Dogelog players, but support is not yet universal
across platforms. Jekejeke Prolog should use sys_open/4
temporarily until we adjust path searching.

- Affine JSON: There is a new library(util/json)
that delivers read_json/[1,2] and write_json/[1,2].
The mapping is affine, since we map JSON lists to
prolog lists and JSON structures to prolog sets.
We also use the new constants 0rNone, 0rFalse
and 0rTrue. Library also available as
library(json) in Dogelog player.

Have Fun!
Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2048&group=comp.lang.prolog#2048

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5a49:0:b0:3d5:49eb:4d1e with SMTP id o9-20020ac85a49000000b003d549eb4d1emr4164182qta.1.1684780943606;
Mon, 22 May 2023 11:42:23 -0700 (PDT)
X-Received: by 2002:a25:8f8c:0:b0:ba8:373e:acf1 with SMTP id
u12-20020a258f8c000000b00ba8373eacf1mr6865130ybl.12.1684780943265; Mon, 22
May 2023 11:42:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 22 May 2023 11:42:22 -0700 (PDT)
In-Reply-To: <u4d5pl$9pjm$4@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <u4d5pl$9pjm$4@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 22 May 2023 18:42:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3821
 by: Mostowski Collapse - Mon, 22 May 2023 18:42 UTC

Concerning the ChatGPT example. Its good to see that it
also works in SWI-Prolog. Here are some results:

I guess one can build a SWI-Prolog server that acts as a
ChatGPT relay, accepting some request, and in turn
making a request on the OpenAI API. So the bearer token
from OpenAI API remains in the SWI-Prolog relay,

and doesn’t become visible to the end user browser
client. It seems it is possibly to make the afforementioned
request via http_open/3, since server side no CORS needs
to be in effect. CORS is only a browser safety thingy.

This example code worked for me:

:- use_module(library(http/http_open)).
:- use_module(library(http/json)).

quizzswi :-
atom_json_term(Request, _{model:'text-davinci-003',
prompt:'Generate a single random multiple choice quizz about Switzerland',
max_tokens:100,
temperature:0.7,
n:1}, []),
http_open('https://api.openai.com/v1/completions', Stream, [authorization(
bearer('###########')),
post(atom('application/json', Request))]),
json_read(Stream, Response),
close(Stream),
write(Response), nl.

Mostowski Collapse schrieb am Sonntag, 21. Mai 2023 um 15:19:54 UTC+2:
> (Sorry for multiple posts, looks like my human
> post mechanism isn't working correctly)
>
> Dear All,
>
> We are happy to announce a new version of the former
> Jekejeke runtime 1.6.0, now called Dogelog runtime.
>
> - Script Mode: The Prolog flag argv is now supported.
> The Prolog interpreter can be called in the form
> "prolog text arg1 .. argn". The "text" file is then
> automatically consulted and "arg1 .. argn" ends up
> in argv as a list of prolog atoms. Furthermore,
> there is now the directive initialization/1. Both
> features are also available in Dogelog Player.
>
> - POST Requests: The open/[3,4] predicates have long
> been able to understand the http: and https: protocol.
> The new options method/1, headers/1 and body/1 are
> self-explanatory. The options are also available in
> Dogelog players, but support is not yet universal
> across platforms. Jekejeke Prolog should use sys_open/4
> temporarily until we adjust path searching.
>
> - Affine JSON: There is a new library(util/json)
> that delivers read_json/[1,2] and write_json/[1,2].
> The mapping is affine, since we map JSON lists to
> prolog lists and JSON structures to prolog sets.
> We also use the new constants 0rNone, 0rFalse
> and 0rTrue. Library also available as
> library(json) in Dogelog player.
>
> Have Fun!
> Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<u4gd68$br5n$1@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2049&group=comp.lang.prolog#2049

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
Date: Mon, 22 May 2023 20:44:25 +0200
Message-ID: <u4gd68$br5n$1@solani.org>
References: <u4d5pl$9pjm$4@solani.org>
<f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 May 2023 18:44:24 -0000 (UTC)
Injection-Info: solani.org;
logging-data="388279"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:RcKCO0Htpohxn3p/KeeAzWVmCCA=
X-User-ID: eJwdysERwDAIA7CVCsaGjhOSsP8IvaveImTaGaKCw6mujHsdqAJ3omYW0e/pZaDMQfic9m2P8ppi/d2PIfF+PnAUoA==
In-Reply-To: <f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>
 by: Mostowski Collapse - Mon, 22 May 2023 18:44 UTC

You need to replace ########### by your API token. It gives me:

/* SWI-Prolog 9.1.9 */
?- quizzswi.
json([id=cmpl-7J4ek6NK0ICXXKv0P69F7uHWOx3jg,object=text_completion,
created=1684780486,model=text-davinci-003,choices=[json([text=

Q. What is the official language of Switzerland?
A. A. French
B. German
C. Italian
D. Swiss German,index=0,logprobs= @(null),finish_reason=stop])],
usage=json([prompt_tokens=10,completion_tokens=35,total_tokens=45])])
true.

Have Fun!

Mostowski Collapse schrieb:
> Concerning the ChatGPT example. Its good to see that it
> also works in SWI-Prolog. Here are some results:
>
> I guess one can build a SWI-Prolog server that acts as a
> ChatGPT relay, accepting some request, and in turn
> making a request on the OpenAI API. So the bearer token
> from OpenAI API remains in the SWI-Prolog relay,
>
> and doesn’t become visible to the end user browser
> client. It seems it is possibly to make the afforementioned
> request via http_open/3, since server side no CORS needs
> to be in effect. CORS is only a browser safety thingy.
>
> This example code worked for me:
>
> :- use_module(library(http/http_open)).
> :- use_module(library(http/json)).
>
> quizzswi :-
> atom_json_term(Request, _{model:'text-davinci-003',
> prompt:'Generate a single random multiple choice quizz about Switzerland',
> max_tokens:100,
> temperature:0.7,
> n:1}, []),
> http_open('https://api.openai.com/v1/completions', Stream, [authorization(
> bearer('###########')),
> post(atom('application/json', Request))]),
> json_read(Stream, Response),
> close(Stream),
> write(Response), nl.
>
> Mostowski Collapse schrieb am Sonntag, 21. Mai 2023 um 15:19:54 UTC+2:
>> (Sorry for multiple posts, looks like my human
>> post mechanism isn't working correctly)
>>
>> Dear All,
>>
>> We are happy to announce a new version of the former
>> Jekejeke runtime 1.6.0, now called Dogelog runtime.
>>
>> - Script Mode: The Prolog flag argv is now supported.
>> The Prolog interpreter can be called in the form
>> "prolog text arg1 .. argn". The "text" file is then
>> automatically consulted and "arg1 .. argn" ends up
>> in argv as a list of prolog atoms. Furthermore,
>> there is now the directive initialization/1. Both
>> features are also available in Dogelog Player.
>>
>> - POST Requests: The open/[3,4] predicates have long
>> been able to understand the http: and https: protocol.
>> The new options method/1, headers/1 and body/1 are
>> self-explanatory. The options are also available in
>> Dogelog players, but support is not yet universal
>> across platforms. Jekejeke Prolog should use sys_open/4
>> temporarily until we adjust path searching.
>>
>> - Affine JSON: There is a new library(util/json)
>> that delivers read_json/[1,2] and write_json/[1,2].
>> The mapping is affine, since we map JSON lists to
>> prolog lists and JSON structures to prolog sets.
>> We also use the new constants 0rNone, 0rFalse
>> and 0rTrue. Library also available as
>> library(json) in Dogelog player.
>>
>> Have Fun!
>> Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<f4aa390c-4f1b-49f6-9af6-257849cd8851n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2050&group=comp.lang.prolog#2050

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1a01:b0:3f6:ae6d:6c3d with SMTP id f1-20020a05622a1a0100b003f6ae6d6c3dmr4263858qtb.12.1685006444076;
Thu, 25 May 2023 02:20:44 -0700 (PDT)
X-Received: by 2002:a25:6612:0:b0:b94:6989:7fa6 with SMTP id
a18-20020a256612000000b00b9469897fa6mr1599880ybc.4.1685006443543; Thu, 25 May
2023 02:20:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 25 May 2023 02:20:43 -0700 (PDT)
In-Reply-To: <u4gd68$br5n$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <u4d5pl$9pjm$4@solani.org> <f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>
<u4gd68$br5n$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f4aa390c-4f1b-49f6-9af6-257849cd8851n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 25 May 2023 09:20:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5758
 by: Mostowski Collapse - Thu, 25 May 2023 09:20 UTC

Note: In some new examples I am using 'argv' together with
some config.p file, which is a nice example that shows a
library(macro) would be useless.

Basically it can be more versatile to have facts. For example
the following doesn’t work with (#)/1 expansion. First the
facts, the “configuration” file:

foo(a).
foo(b).

bar(a, jack).
bar(b, jill).
bar(c, baz).

Now the client code, some failure driven loop:

:- (foo(X), bar(X,Y), do_something(X,Y), fail; true).

One cannot do this with compile time expansion.
Unless one wants to expand it to:

:- (do_something(a,jack), fail;
do_something(b,jill), fail;
true).

But individually expanded #a and #b at compile time
into jack and jill would be useless.

Mostowski Collapse schrieb am Montag, 22. Mai 2023 um 20:46:33 UTC+2:
> You need to replace ########### by your API token. It gives me:
>
> /* SWI-Prolog 9.1.9 */
> ?- quizzswi.
> json([id=cmpl-7J4ek6NK0ICXXKv0P69F7uHWOx3jg,object=text_completion,
> created=1684780486,model=text-davinci-003,choices=[json([text=
>
> Q. What is the official language of Switzerland?
> A. A. French
> B. German
> C. Italian
> D. Swiss German,index=0,logprobs= @(null),finish_reason=stop])],
> usage=json([prompt_tokens=10,completion_tokens=35,total_tokens=45])])
> true.
>
> Have Fun!
>
> Mostowski Collapse schrieb:
> > Concerning the ChatGPT example. Its good to see that it
> > also works in SWI-Prolog. Here are some results:
> >
> > I guess one can build a SWI-Prolog server that acts as a
> > ChatGPT relay, accepting some request, and in turn
> > making a request on the OpenAI API. So the bearer token
> > from OpenAI API remains in the SWI-Prolog relay,
> >
> > and doesn’t become visible to the end user browser
> > client. It seems it is possibly to make the afforementioned
> > request via http_open/3, since server side no CORS needs
> > to be in effect. CORS is only a browser safety thingy.
> >
> > This example code worked for me:
> >
> > :- use_module(library(http/http_open)).
> > :- use_module(library(http/json)).
> >
> > quizzswi :-
> > atom_json_term(Request, _{model:'text-davinci-003',
> > prompt:'Generate a single random multiple choice quizz about Switzerland',
> > max_tokens:100,
> > temperature:0.7,
> > n:1}, []),
> > http_open('https://api.openai.com/v1/completions', Stream, [authorization(
> > bearer('###########')),
> > post(atom('application/json', Request))]),
> > json_read(Stream, Response),
> > close(Stream),
> > write(Response), nl.
> >
> > Mostowski Collapse schrieb am Sonntag, 21. Mai 2023 um 15:19:54 UTC+2:
> >> (Sorry for multiple posts, looks like my human
> >> post mechanism isn't working correctly)
> >>
> >> Dear All,
> >>
> >> We are happy to announce a new version of the former
> >> Jekejeke runtime 1.6.0, now called Dogelog runtime.
> >>
> >> - Script Mode: The Prolog flag argv is now supported.
> >> The Prolog interpreter can be called in the form
> >> "prolog text arg1 .. argn". The "text" file is then
> >> automatically consulted and "arg1 .. argn" ends up
> >> in argv as a list of prolog atoms. Furthermore,
> >> there is now the directive initialization/1. Both
> >> features are also available in Dogelog Player.
> >>
> >> - POST Requests: The open/[3,4] predicates have long
> >> been able to understand the http: and https: protocol.
> >> The new options method/1, headers/1 and body/1 are
> >> self-explanatory. The options are also available in
> >> Dogelog players, but support is not yet universal
> >> across platforms. Jekejeke Prolog should use sys_open/4
> >> temporarily until we adjust path searching.
> >>
> >> - Affine JSON: There is a new library(util/json)
> >> that delivers read_json/[1,2] and write_json/[1,2].
> >> The mapping is affine, since we map JSON lists to
> >> prolog lists and JSON structures to prolog sets.
> >> We also use the new constants 0rNone, 0rFalse
> >> and 0rTrue. Library also available as
> >> library(json) in Dogelog player.
> >>
> >> Have Fun!
> >> Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<9e4593fa-0520-4437-a009-6439a9070a32n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2055&group=comp.lang.prolog#2055

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:11d0:b0:3f6:1f6e:b022 with SMTP id n16-20020a05622a11d000b003f61f6eb022mr1330728qtk.3.1685190684802;
Sat, 27 May 2023 05:31:24 -0700 (PDT)
X-Received: by 2002:a81:a844:0:b0:55d:9e7c:72c0 with SMTP id
f65-20020a81a844000000b0055d9e7c72c0mr1330536ywh.0.1685190684511; Sat, 27 May
2023 05:31:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 27 May 2023 05:31:24 -0700 (PDT)
In-Reply-To: <f4aa390c-4f1b-49f6-9af6-257849cd8851n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <u4d5pl$9pjm$4@solani.org> <f3a0ca21-a30c-4f00-b703-e3d581290b94n@googlegroups.com>
<u4gd68$br5n$1@solani.org> <f4aa390c-4f1b-49f6-9af6-257849cd8851n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e4593fa-0520-4437-a009-6439a9070a32n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Sat, 27 May 2023 12:31:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 153
 by: Mild Shock - Sat, 27 May 2023 12:31 UTC

One could use prefix (‘.’)/1 instead of (#)/1. So that it is kind of a
special case of the dict dot notation, refering to a kind of a global
context. At least the Prolog parser seems to be able to read such terms:

?- op(10, fx, '.').
true.

?- X = .a .
X = '.'a.

So if we have a dict X with some constant max, its already possible
to write the following code:

/* SWI-Prolog 9.1.9 */
?- X = _{foo:123, bar:'baz', max:100}, write(X.max), nl.
100
X = _{bar:baz, foo:123, max:100}.

The writing of .max alone, without a receiver would indicate that
we refer to some global definition. A variant of User defined
functions on dicts:

/* Hypothetical */
..max := 100.

?- write(.max), nl.
100

Or extend function on dicts that they understand a receiver which
is not a dict, but a name of a dict, somewhere define. Could also
lead to some modularization of constants.

Mostowski Collapse schrieb am Donnerstag, 25. Mai 2023 um 11:20:45 UTC+2:
> Note: In some new examples I am using 'argv' together with
> some config.p file, which is a nice example that shows a
> library(macro) would be useless.
>
> Basically it can be more versatile to have facts. For example
> the following doesn’t work with (#)/1 expansion. First the
> facts, the “configuration” file:
>
> foo(a).
> foo(b).
>
> bar(a, jack).
> bar(b, jill).
> bar(c, baz).
>
> Now the client code, some failure driven loop:
>
> :- (foo(X), bar(X,Y), do_something(X,Y), fail; true).
>
> One cannot do this with compile time expansion.
> Unless one wants to expand it to:
>
> :- (do_something(a,jack), fail;
> do_something(b,jill), fail;
> true).
>
> But individually expanded #a and #b at compile time
> into jack and jill would be useless.
> Mostowski Collapse schrieb am Montag, 22. Mai 2023 um 20:46:33 UTC+2:
> > You need to replace ########### by your API token. It gives me:
> >
> > /* SWI-Prolog 9.1.9 */
> > ?- quizzswi.
> > json([id=cmpl-7J4ek6NK0ICXXKv0P69F7uHWOx3jg,object=text_completion,
> > created=1684780486,model=text-davinci-003,choices=[json([text=
> >
> > Q. What is the official language of Switzerland?
> > A. A. French
> > B. German
> > C. Italian
> > D. Swiss German,index=0,logprobs= @(null),finish_reason=stop])],
> > usage=json([prompt_tokens=10,completion_tokens=35,total_tokens=45])])
> > true.
> >
> > Have Fun!
> >
> > Mostowski Collapse schrieb:
> > > Concerning the ChatGPT example. Its good to see that it
> > > also works in SWI-Prolog. Here are some results:
> > >
> > > I guess one can build a SWI-Prolog server that acts as a
> > > ChatGPT relay, accepting some request, and in turn
> > > making a request on the OpenAI API. So the bearer token
> > > from OpenAI API remains in the SWI-Prolog relay,
> > >
> > > and doesn’t become visible to the end user browser
> > > client. It seems it is possibly to make the afforementioned
> > > request via http_open/3, since server side no CORS needs
> > > to be in effect. CORS is only a browser safety thingy.
> > >
> > > This example code worked for me:
> > >
> > > :- use_module(library(http/http_open)).
> > > :- use_module(library(http/json)).
> > >
> > > quizzswi :-
> > > atom_json_term(Request, _{model:'text-davinci-003',
> > > prompt:'Generate a single random multiple choice quizz about Switzerland',
> > > max_tokens:100,
> > > temperature:0.7,
> > > n:1}, []),
> > > http_open('https://api.openai.com/v1/completions', Stream, [authorization(
> > > bearer('###########')),
> > > post(atom('application/json', Request))]),
> > > json_read(Stream, Response),
> > > close(Stream),
> > > write(Response), nl.
> > >
> > > Mostowski Collapse schrieb am Sonntag, 21. Mai 2023 um 15:19:54 UTC+2:
> > >> (Sorry for multiple posts, looks like my human
> > >> post mechanism isn't working correctly)
> > >>
> > >> Dear All,
> > >>
> > >> We are happy to announce a new version of the former
> > >> Jekejeke runtime 1.6.0, now called Dogelog runtime.
> > >>
> > >> - Script Mode: The Prolog flag argv is now supported.
> > >> The Prolog interpreter can be called in the form
> > >> "prolog text arg1 .. argn". The "text" file is then
> > >> automatically consulted and "arg1 .. argn" ends up
> > >> in argv as a list of prolog atoms. Furthermore,
> > >> there is now the directive initialization/1. Both
> > >> features are also available in Dogelog Player.
> > >>
> > >> - POST Requests: The open/[3,4] predicates have long
> > >> been able to understand the http: and https: protocol.
> > >> The new options method/1, headers/1 and body/1 are
> > >> self-explanatory. The options are also available in
> > >> Dogelog players, but support is not yet universal
> > >> across platforms. Jekejeke Prolog should use sys_open/4
> > >> temporarily until we adjust path searching.
> > >>
> > >> - Affine JSON: There is a new library(util/json)
> > >> that delivers read_json/[1,2] and write_json/[1,2].
> > >> The mapping is affine, since we map JSON lists to
> > >> prolog lists and JSON structures to prolog sets.
> > >> We also use the new constants 0rNone, 0rFalse
> > >> and 0rTrue. Library also available as
> > >> library(json) in Dogelog player.
> > >>
> > >> Have Fun!
> > >> Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<u558k8$lnr4$1@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2057&group=comp.lang.prolog#2057

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
Date: Tue, 30 May 2023 18:35:20 +0200
Message-ID: <u558k8$lnr4$1@solani.org>
References: <u4d5pl$9pjm$4@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 30 May 2023 16:35:20 -0000 (UTC)
Injection-Info: solani.org;
logging-data="712548"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:QxVXVqb1tyZ7VGNZzhwriK/i7D8=
In-Reply-To: <u4d5pl$9pjm$4@solani.org>
X-User-ID: eJwFwYkBADAEBLCVKEeN46n9R2gCMbZ2NZhisd5X8jy1EfbUEgY1rr9He+OAZrckMoOy62RymWg0Yw4q5wNQixXb
 by: Mild Shock - Tue, 30 May 2023 16:35 UTC

Dogelog Player is a Prolog system 100%
written in Prolog based on Novacore, a
very small Prolog kernel and bundled set
of libraries. We started adopting the
Novacore libraries by formerly Jekejeke
Prolog and are now heading into
allowing them for GNU Prolog.

GNU Prolog doesn’t support bigint or
Unicode, which we could workaround in
that we disabled these test cases. Maybe
there are forks around that support these
features? The results are encouraging,
GNU Prolog currently has some precentage
failure rate around 25%.

See also:

Novacore Libraries on GNU Prolog
https://twitter.com/dogelogch/status/1663580904885714958

Novacore Libraries on GNU Prolog
https://www.facebook.com/groups/dogelog

Mostowski Collapse schrieb:
> (Sorry for multiple posts, looks like my human
> post mechanism isn't working correctly)
>
> Dear All,
>
> We are happy to announce a new version of the former
> Jekejeke runtime 1.6.0, now called Dogelog runtime.
>
> - Script Mode: The Prolog flag argv is now supported.
> The Prolog interpreter can be called in the form
> "prolog text arg1 .. argn". The "text" file is then
> automatically consulted and "arg1 .. argn" ends up
> in argv as a list of prolog atoms. Furthermore,
> there is now the directive initialization/1. Both
> features are also available in Dogelog Player.
>
> - POST Requests: The open/[3,4] predicates have long
> been able to understand the http: and https: protocol.
> The new options method/1, headers/1 and body/1 are
> self-explanatory. The options are also available in
> Dogelog players, but support is not yet universal
> across platforms. Jekejeke Prolog should use sys_open/4
> temporarily until we adjust path searching.
>
> - Affine JSON: There is a new library(util/json)
> that delivers read_json/[1,2] and write_json/[1,2].
> The mapping is affine, since we map JSON lists to
> prolog lists and JSON structures to prolog sets.
> We also use the new constants 0rNone, 0rFalse
> and 0rTrue. Library also available as
> library(json) in Dogelog player.
>
> Have Fun!
> Jan Burse, 21.05.2023, http://www.xlog.ch/

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<u5qjh8$11ii3$1@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2066&group=comp.lang.prolog#2066

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
Date: Wed, 7 Jun 2023 20:50:16 +0200
Message-ID: <u5qjh8$11ii3$1@solani.org>
References: <u4d5pl$9pjm$4@solani.org> <u558k8$lnr4$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 7 Jun 2023 18:50:16 -0000 (UTC)
Injection-Info: solani.org;
logging-data="1100355"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:HBv6ldET1T1QbYoKG57p3ykrtg8=
X-User-ID: eJwFwYEBACAEBMCVEv41jsL+I3TnCsGjwWE+Pjgkslyus3F9p02j6lJO3TWaFYexdD+u6adpm2IdmOqI/lmaFd4=
In-Reply-To: <u558k8$lnr4$1@solani.org>
 by: Mild Shock - Wed, 7 Jun 2023 18:50 UTC

We recently submerged into accessing OpenAI API
via HTTP POST requests. They are now supported by
both Jekejeke Prolog and Dogelog Player. While
testing the Dogelog Player HTTP POST requests we
stepped over some limitation of common echo
servers and built our own.

We chose the Java based implementation from
Apache of the Tomcat web server that can even
serve the HTTP/2 protocol. By means of our Echo
servlet we could start testing Dogelog Player
in the browser, concerning the new support for
open options method/1, body/1 and headers/1.

See also:

Roll your Echo Server via Tomcat - Dogelog, 2023
https://twitter.com/dogelogch/status/1666516167152771095

Roll your Echo Server via Tomcat - Dogelog, 2023
https://www.facebook.com/groups/dogelog

Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)

<15f592d1-a70c-43d9-8c32-f6dcdd8ffd42n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2080&group=comp.lang.prolog#2080

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:178e:b0:767:e785:1c30 with SMTP id ay14-20020a05620a178e00b00767e7851c30mr84797qkb.1.1689591119959;
Mon, 17 Jul 2023 03:51:59 -0700 (PDT)
X-Received: by 2002:a05:6870:5a96:b0:1b0:5c0a:c047 with SMTP id
dt22-20020a0568705a9600b001b05c0ac047mr10706169oab.2.1689591119623; Mon, 17
Jul 2023 03:51:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 17 Jul 2023 03:51:59 -0700 (PDT)
In-Reply-To: <u5qjh8$11ii3$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <u4d5pl$9pjm$4@solani.org> <u558k8$lnr4$1@solani.org> <u5qjh8$11ii3$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <15f592d1-a70c-43d9-8c32-f6dcdd8ffd42n@googlegroups.com>
Subject: Re: ANN: Dogelog Runtime 1.6.0 (POST Requests)
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Mon, 17 Jul 2023 10:51:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1862
 by: Mild Shock - Mon, 17 Jul 2023 10:51 UTC

Althout Python has a Decimal module and decimal
modules exist for nodeJS. Decimals did not yet make
it into Dogelog Player, and are also still a moving target in
Jekejeke Prolog. We did a small refinement for Jekejeke
Prolog concering basic arithmethic and comparison.

The money type provided us with mathematical
functions, but it also enlarged the native footprint. We
removed the money type and went with an Prolog
module to overload basic arithmetic. We also fixed
the syntactic comparison problem for BigDecimals.

See also:

Improved Decimals in Jekejeke Prolog
https://twitter.com/dogelogch/status/1680891639449939971

Improved Decimals in Jekejeke Prolog
https://www.facebook.com/groups/dogelog

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor