Please make sure the OpenAI API key is set correctly in the settings
6 |Sorry, there's nothing at this address.
10 |14 | @action.Text 15 |
16 |@note
8 | } 9 |
59 |
--------------------------------------------------------------------------------
/WAGIapp/wwwroot/service-worker.published.js:
--------------------------------------------------------------------------------
1 | // Caution! Be sure you understand the caveats before publishing an application with
2 | // offline support. See https://aka.ms/blazor-offline-considerations
3 |
4 | self.importScripts('./service-worker-assets.js');
5 | self.addEventListener('install', event => event.waitUntil(onInstall(event)));
6 | self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
7 | self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
8 |
9 | const cacheNamePrefix = 'offline-cache-';
10 | const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
11 | const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
12 | const offlineAssetsExclude = [ /^service-worker\.js$/ ];
13 |
14 | async function onInstall(event) {
15 | console.info('Service worker: Install');
16 |
17 | // Fetch and cache all matching items from the assets manifest
18 | const assetsRequests = self.assetsManifest.assets
19 | .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
20 | .filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
21 | .map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
22 | await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
23 | }
24 |
25 | async function onActivate(event) {
26 | console.info('Service worker: Activate');
27 |
28 | // Delete unused caches
29 | const cacheKeys = await caches.keys();
30 | await Promise.all(cacheKeys
31 | .filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
32 | .map(key => caches.delete(key)));
33 | }
34 |
35 | async function onFetch(event) {
36 | let cachedResponse = null;
37 | if (event.request.method === 'GET') {
38 | // For all navigation requests, try to serve index.html from cache
39 | const shouldServeIndexHtml = event.request.mode === 'navigate';
40 |
41 | const request = shouldServeIndexHtml ? 'index.html' : event.request;
42 | const cache = await caches.open(cacheName);
43 | cachedResponse = await cache.match(request);
44 | }
45 |
46 | return cachedResponse || fetch(event.request);
47 | }
48 |
--------------------------------------------------------------------------------
/WAGIapp/AI/Memory.cs:
--------------------------------------------------------------------------------
1 | namespace WAGIapp.AI
2 | {
3 | internal class Memory
4 | {
5 | public string Content { get; private set; }
6 | public HashSet