Plusieurs gros ajouts :
- Possibilité de discuter avec un PDF ; RAG ou analyse approfondie. Enlèvement de l'autre outil PDF de discussion qui analysait d'abord un PDF en proposant directement une intégration sans attendre qu'on pose de question - Mise en place de l'import directement dans les outils dans la sidebar - Mise en place d'un outil pour créer des tables aléatoires avec possibilité d'utiliser pendant la partie - Mise en place d'un outil pour mettre en place des PNJ, scènes, chapitre.... directement à partir de la discussion avec le PDF - Mise en place RAG avec mistal-embeding ou nomic si on utilise ollama - Mise en place mistral, google en fournisseurs alternatifs pour l'IA dans le cloud - version 0.11.0-bêta
This commit is contained in:
49
web/src/app/services/random-table.service.ts
Normal file
49
web/src/app/services/random-table.service.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RandomTable, RandomTableCreate } from './random-table.model';
|
||||
|
||||
/**
|
||||
* CRUD des tables aléatoires (campagne). Mirroir de NpcService.
|
||||
*/
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class RandomTableService {
|
||||
private apiUrl = '/api/random-tables';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
getByCampaign(campaignId: string): Observable<RandomTable[]> {
|
||||
return this.http.get<RandomTable[]>(`${this.apiUrl}/campaign/${campaignId}`);
|
||||
}
|
||||
|
||||
getById(id: string): Observable<RandomTable> {
|
||||
return this.http.get<RandomTable>(`${this.apiUrl}/${id}`);
|
||||
}
|
||||
|
||||
create(payload: RandomTableCreate): Observable<RandomTable> {
|
||||
return this.http.post<RandomTable>(this.apiUrl, payload);
|
||||
}
|
||||
|
||||
update(id: string, payload: RandomTable): Observable<RandomTable> {
|
||||
return this.http.put<RandomTable>(`${this.apiUrl}/${id}`, payload);
|
||||
}
|
||||
|
||||
delete(id: string): Observable<void> {
|
||||
return this.http.delete<void>(`${this.apiUrl}/${id}`);
|
||||
}
|
||||
|
||||
/** Génère une PROPOSITION de table via l'IA (non persistée) à préremplir dans le formulaire. */
|
||||
generate(campaignId: string, description: string, diceFormula: string): Observable<RandomTable> {
|
||||
return this.http.post<RandomTable>(`${this.apiUrl}/generate`, { campaignId, description, diceFormula });
|
||||
}
|
||||
|
||||
/** Improvisation IA d'un court récit sur un résultat tiré (en partie). */
|
||||
improvise(
|
||||
campaignId: string, tableName: string, resultLabel: string, resultDetail: string
|
||||
): Observable<{ narration: string }> {
|
||||
return this.http.post<{ narration: string }>(
|
||||
`${this.apiUrl}/improvise`,
|
||||
{ campaignId, tableName, resultLabel, resultDetail }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user