Skip to content

Commit 04cdf66

Browse files
committed
remove dated info
1 parent 59d17a8 commit 04cdf66

File tree

2 files changed

+0
-68
lines changed

2 files changed

+0
-68
lines changed

MyApp/_pages/ai-chat-api.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -405,40 +405,6 @@ class MyService(IChatClients clients)
405405
}
406406
```
407407

408-
## Persist AI Chat History
409-
410-
By default AI Chat is designed to be minimally invasive and doesn't require anything other than the API Keys
411-
needed to access the AI Models it should use.
412-
413-
If preferred you can choose to persist AI Chat History made through the external ChatCompletion API with the
414-
`OnChatCompletionSuccessAsync` and `OnChatCompletionFailedAsync` callbacks which can be used to store successful
415-
and failed requests in your preferred data store using the included
416-
[ChatCompletionLog](https://github.com/ServiceStack/ServiceStack/blob/main/ServiceStack/src/ServiceStack.AI.Chat/ChatCompletionLog.cs)
417-
or your own data model:
418-
419-
```csharp
420-
public class ConfigureAiChat : IHostingStartup
421-
{
422-
public void Configure(IWebHostBuilder builder) => builder
423-
.ConfigureServices(services => {
424-
services.AddPlugin(new ChatFeature
425-
{
426-
OnChatCompletionSuccessAsync = async (request, response, req) => {
427-
using var db = await req.Resolve<IDbConnectionFactory>().OpenAsync();
428-
await db.InsertAsync(req.ToChatCompletionLog(request, response));
429-
},
430-
OnChatCompletionFailedAsync = async (request, exception, req) => {
431-
using var db = await req.Resolve<IDbConnectionFactory>().OpenAsync();
432-
await db.InsertAsync(req.ToChatCompletionLog(request, exception));
433-
},
434-
});
435-
}).ConfigureAppHost(appHost => {
436-
using var db = appHost.Resolve<IDbConnectionFactory>().Open();
437-
db.CreateTableIfNotExists<ChatCompletionLog>();
438-
});
439-
}
440-
```
441-
442408
### Compatible with llms.py
443409

444410
The other benefit of simple configuration and simple solutions, is that they're easy to implement. A perfect example

MyApp/_pages/releases/v8_09.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,40 +2631,6 @@ class MyService(IChatClients clients)
26312631
}
26322632
```
26332633

2634-
## Persist AI Chat History
2635-
2636-
By default AI Chat is designed to be minimally invasive and doesn't require anything other than the API Keys
2637-
needed to access the AI Models it should use.
2638-
2639-
If preferred you can choose to persist AI Chat History made through the external ChatCompletion API with the
2640-
`OnChatCompletionSuccessAsync` and `OnChatCompletionFailedAsync` callbacks which can be used to store successful
2641-
and failed requests in your preferred data store using the included
2642-
[ChatCompletionLog](https://github.com/ServiceStack/ServiceStack/blob/main/ServiceStack/src/ServiceStack.AI.Chat/ChatCompletionLog.cs)
2643-
or your own data model:
2644-
2645-
```csharp
2646-
public class ConfigureAiChat : IHostingStartup
2647-
{
2648-
public void Configure(IWebHostBuilder builder) => builder
2649-
.ConfigureServices(services => {
2650-
services.AddPlugin(new ChatFeature
2651-
{
2652-
OnChatCompletionSuccessAsync = async (request, response, req) => {
2653-
using var db = await req.Resolve<IDbConnectionFactory>().OpenAsync();
2654-
await db.InsertAsync(req.ToChatCompletionLog(request, response));
2655-
},
2656-
OnChatCompletionFailedAsync = async (request, exception, req) => {
2657-
using var db = await req.Resolve<IDbConnectionFactory>().OpenAsync();
2658-
await db.InsertAsync(req.ToChatCompletionLog(request, exception));
2659-
},
2660-
});
2661-
}).ConfigureAppHost(appHost => {
2662-
using var db = appHost.Resolve<IDbConnectionFactory>().Open();
2663-
db.CreateTableIfNotExists<ChatCompletionLog>();
2664-
});
2665-
}
2666-
```
2667-
26682634
### Compatible with llms.py
26692635

26702636
The other benefit of simple configuration and simple solutions, is that they're easy to implement. A perfect example

0 commit comments

Comments
 (0)