Skip to content

Commit

Permalink
add synthezis display
Browse files Browse the repository at this point in the history
  • Loading branch information
haladamateusz committed Oct 29, 2023
1 parent a800fbc commit 12d1638
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions frontend/src/app/service/llama/llama.service.ts
Expand Up @@ -15,30 +15,31 @@ export class LlamaService {
private lastAnswer = new BehaviorSubject('');

askQuestion(question: string, userId: string): Observable<LlamaResponseResult> {
return of({ ...LlamaResponseMock, question, userId }).pipe(
tap(data => {
this.lastResults.next(data);
this.lastQuestionAsked.next(question);
this.lastAnswer.next(data.answer);
})
);
// return this.httpClient
// .post<LlamaResponseResult>('http://127.0.0.1:8000/askQuestion/', { question, userId })
// .pipe(
// tap(data => {
// this.lastResults.next(data);
// this.lastQuestionAsked.next(question);
// })
// );
// return of({ ...LlamaResponseMock, question, userId }).pipe(
// tap(data => {
// this.lastResults.next(data);
// this.lastQuestionAsked.next(question);
// this.lastAnswer.next(data.answer);
// })
// );
return this.httpClient
.post<LlamaResponseResult>('http://127.0.0.1:8000/askQuestion/', { question, userId })
.pipe(
tap(data => {
this.lastResults.next(data);
this.lastQuestionAsked.next(question);
})
);
}

sendFeedback(feedback: FEEDBACK, userId: string): Observable<boolean> {
return of(true);
// return this.httpClient.post<boolean>('http://127.0.0.1:8000/sendFeedback/', {
// feedback,
// userId,
// previousQuestion: this.lastQuestionAsked.getValue(),
// previousResults: this.lastResults.getValue()
// });
// return of(true);
return this.httpClient.post<boolean>('http://127.0.0.1:8000/sendFeedback/', {
feedback,
userId,
previousQuestion: this.lastQuestionAsked.getValue(),
previousResults: this.lastResults.getValue(),
previousAnswer: this.lastAnswer.getValue()
});
}
}

0 comments on commit 12d1638

Please sign in to comment.