[00:38] *** deoac left
[01:15] *** thowe left
[01:15] *** thowe joined
[06:11] *** jgaz left
[06:13] *** jgaz joined
[07:41] *** Manifest0 joined
[08:06] *** dakkar joined
[08:21] *** tea3po left
[08:21] *** tea3po joined
[10:45] *** guifa left
[14:56] *** SmokeMachine left
[14:57] *** mjgardner left
[14:57] *** tbrowder__ left
[14:59] *** mjgardner joined
[14:59] *** tbrowder__ joined
[14:59] *** SmokeMachine joined
[15:49] <discord-raku-bot> <rcmlz> Hello Anton, I started using it. There is an issue with people that do not have enough "quota" - will put some money up. The error message is fine, however, for people new to Raku the "Use of uninitialized value element of type Any in string context. ... " is scary.  error => {code => insufficient_quota, message => You exceeded your current quota, please check your plan and billing details., param => (Any),

[15:49] <discord-raku-bot> type => insufficient_quota}  Use of uninitialized value element of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.   in method eval at /usr/local/Cellar/rakudo-star/2023.08/share/perl6/site/sources/2CBCBF8A4A1670092BE1E1523080764269775230 (LLM::Functions::Chat) line 80   in method eval at

[15:49] <discord-raku-bot> /usr/local/Cellar/rakudo-star/2023.08/share/perl6/site/sources/2CBCBF8A4A1670092BE1E1523080764269775230 (LLM::Functions::Chat) line 56   in block <unit> at <unknown file> line 1   in method eval at /usr/local/Cellar/rakudo-star/2023.08/share/perl6/site/sources/C24820763DE9E6A4B431D7F0A8945616880E1EA8 (Jupyter::Kernel::Sandbox) line 139   in code  at

[15:49] <discord-raku-bot> /usr/local/Cellar/rakudo-star/2023.08/share/perl6/site/sources/DA76AEE5D68CD02B4E42BCB2570746B82B483811 (Jupyter::Kernel) line 147

[15:50] <discord-raku-bot> <rcmlz> I will record issues in github

[15:55] <discord-raku-bot> <antononcube> @rcmlz Thanks a lot! At this point I am really not sure what is the best way to handle these kind errors. This gets more complicated because different LLMs handle these kind of errors differently.

[15:57] <discord-raku-bot> <rcmlz> PS: how far do I get for 10$?

[15:59] <discord-raku-bot> <antononcube> Hmm... Which LLM service you are using? I assume one of of OpenAIs : but which one? (The "regular", or the "ChatGPT plus".)

[16:01] <discord-raku-bot> <antononcube> Another remark on error handling: PaLM often produces moderation errors. It is a problem with PaLM (which I have reported), but also it is better if there as uniform way of handling moderation errors that is also adopted by the different concrete packages for LLM access.

[16:06] <discord-raku-bot> <antononcube> @rcmlz My bills with OpenAI's regular service rarely exceed $10 per month. I also I have "Plus" which is with a flat rate of $20 per month. (If it is not clear, one pays for these services separately.)

[16:45] *** dakkar left
[17:44] <Tirifto_> Hello again! Just a thought that crossed my mind: Suppose I have a large string in which I’d like to make several substitutions. The substrings I wish to substitue might (or might not) have something in common, e.g. they might all start with the same character. Should I do well to perform several substitutions on that string in order, or is there a more efficient, but comparably simple way, where Raku could perform all of the substitution

[17:44] <Tirifto_> s ‘in one fell swoop’, so to speak?

[17:47] <Tirifto_> I imagine a custom procedure could be written (and perhaps generalised), but I wonder if there is some straightforward method or ‘good practice’ for this kind of thing. cx

[18:21] <gfldex> Tirifto_: You can use .subst with a Callable to that. But that requires a matcher that can match all needles in one go.

[18:25] <discord-raku-bot> <librasteve> Tirifto_: my approach would be to do them sequentially… with normal sized strings this should fit in RAM so I don’t see much performance gain for parallelism and I do see confusion such as what if an early subst contains a later match

[18:25] <gfldex> Or .rindex with a list of needles and .substr if you want to make changes in place. You have to work from the end of the string because substitions may otherwise shift indices.

[18:27] <gfldex> No wait, that is .indices nowadays.

[18:28] <gfldex> Depending on what you want to do, breaking the Str up into a List of Str might be simpler and faster.

[18:34] <discord-raku-bot> <librasteve> gfldex: does rindex mean reverse index?

[18:35] <gfldex> yes

[18:35] <gfldex> But it doesn't take a list of needles.

[18:36] <discord-raku-bot> <librasteve> aha - tx!

[18:37] <discord-raku-bot> <librasteve> ps. i also would consider “sharding” a very large Str (works of Shakespeare ish) … but dealing with boundaries is then a headache.

[18:46] <Tirifto_> Thank you for the advice, gfldex, @librasteve. I suppose writing a Callable would be fairly straightforward and universal, and so applicable to my use case. But I suppose I’ll only experiment with that if performance turns out to be a problem, which I suppose it won’t. xP

[18:54] <gfldex> m: my $s = ‘this is a string.’; my %replace = i => 1, r => 2; say join ‘’, gather for $s.split(<i r>, :p) -> $p { $p ~~ Pair ?? take %replace{$p.value} !! take $p }

[18:54] <camelia> rakudo-moar cfcf9fb3e: OUTPUT: «th1s 1s a st21ng.␤»

[18:55] <gfldex> This is the most flexible because you can use loop-control to bail early, return Empty and such.

[18:56] <gfldex> Also, this shows that gradual typing is just better. :->

[20:21] *** tea3po left
[20:21] *** tea3po joined
[20:23] *** teatwo joined
[20:26] *** tea3po left
