Some minor issues

1) Search LinqPad Ctrl Q
Normally this can be run either by clicking on the button or pressing Ctrl-Q, but when the editor is hidden the button does not work (although pressing Ctrl-Q still works)

2) Editing snippets
Unless I am missing something, there is no way to press return in the editor. (I just switched to LP5 to doing the editing in that)

3) Error "The value cannot be an empty string. (Parameter 'path')" error with Decompile extension

Problem seems to be it is accessing member.Assembly.Location which can be blank for some dynamically loaded assemblies.

Not sure if this can be fixed. If not perhaps a validation check to indicate the actual problem would be helpful.

4) Incorrect url with sample.

Runtime AI - demo - IP address analysis.linq
http.GetStringAsync($"http://ip-api.com/json/{ip}");
needs to be
http.GetStringAsync($"http://www.ip-api.com/json/{ip}");

5) Util.AI.Ask and caching
Would it be possible for the cache key to include the default model if none is specified at runtime, - so that changing the default model won't return the cached results.

Thanks

Comments

  • These should all be fixed in 9.9.2 apart from (5), which I can't reproduce.

  • Thanks for all the fixes.

    Regarding (5), these are the steps that I used to reproduce the issue.

    1. Open the Runtime AI - getting started.linq sample.

    2. Set the default model set to Google: Gemma 3n 2B (free) (via OpenRouter)

    3. Ran the script and I got a blank panel (It appears OpenRouter is returning a 404 which explains the blank panel)

    4. Changed the default model to Anthropic: Opus 4.7 and re-run the script and this time it worked. (Obviously not using the cache, but perhaps blank results are not cached)

    5. Set the default model back to Google: Gemma 3n 2B (free) and re-ran the script and it immediately displayed the exact same results. (From that I concluded it was used the previously cached results.)

    6. Changed the wording on the AI.ASK command and re-ran the script and it returned a blank panel (which seemed to confirm that the previous results were from the cache).

  • This is kind-of what I did, too. Can you send me the code?

  • The original code was your sample, but this is an amended copy which I think shows the issue better.

    Uncapsulate<AIRequest>()._cache.Keys.Dump();
    
    Util.AI.Ask ("What physics principles are required to implement GPS?")
        .Dump(AIModel.DefaultChatModel?.Name);
    

    First with the default as Google: Gemma 3n 2B (free)

    Then with the default as Anthropic: Opus 4.7

    Then with the default back as Google: Gemma 3n 2B (free)

    Note the cache key has the model set as null rather than the actual model used is probably why changing the default model is not enough to generate a new key and bypass the cache.

  • Oh I see - you changed the default model in Settings in between runs?

  • It should be robust to this scenario in 9.9.4.