Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/IronOne-Atrad/RegGPT-Front-end
Browse files
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
title: RegGPT Front End
|
3 |
emoji: 📺
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
thumbnail: >-
|
|
|
1 |
---
|
2 |
title: RegGPT Front End
|
3 |
emoji: 📺
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: gray
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
thumbnail: >-
|
src/app/core/services/request-manager.service.ts
CHANGED
@@ -7,14 +7,15 @@ import { environment } from "src/environments/environment.prod";
|
|
7 |
providedIn: 'root'
|
8 |
})
|
9 |
export class RequestManagerService {
|
10 |
-
private apiUrl = environment.identityServerURL;
|
|
|
11 |
|
12 |
constructor(private http: HttpClient) {}
|
13 |
|
14 |
// Helper function to get headers with Authorization
|
15 |
private getHeaders(): HttpHeaders {
|
16 |
// The actual token, extracted from your URL or environment (adjust as needed)
|
17 |
-
const url = "https://ironone-
|
18 |
const token = url.split('sqwegrwWSAHahf_')[1].split('/')[0]; // Extract token after the prefix, ignoring the rest
|
19 |
console.log('Extracted token:', token); // To verify it's correct
|
20 |
|
@@ -35,6 +36,7 @@ export class RequestManagerService {
|
|
35 |
public post(endpoint: string, data: any): Observable<any> {
|
36 |
const url = `${this.apiUrl}/${endpoint}`;
|
37 |
const headers = this.getHeaders();
|
|
|
38 |
return this.http.post(url, data, { headers });
|
39 |
}
|
40 |
|
|
|
7 |
providedIn: 'root'
|
8 |
})
|
9 |
export class RequestManagerService {
|
10 |
+
// private apiUrl = environment.identityServerURL;
|
11 |
+
private apiUrl = 'https://ironone-ai-labs-reggpt-back-end.hf.space/api/v1';
|
12 |
|
13 |
constructor(private http: HttpClient) {}
|
14 |
|
15 |
// Helper function to get headers with Authorization
|
16 |
private getHeaders(): HttpHeaders {
|
17 |
// The actual token, extracted from your URL or environment (adjust as needed)
|
18 |
+
const url = "https://ironone-ai-labs-reggpt-back-end.hf.space/api/v1/sqwegrwWSAHahf_hf_iFCkXksUTPpVjzzExoaIBmfGelKtvkLNqG/BmfGelKtvkLNqG";
|
19 |
const token = url.split('sqwegrwWSAHahf_')[1].split('/')[0]; // Extract token after the prefix, ignoring the rest
|
20 |
console.log('Extracted token:', token); // To verify it's correct
|
21 |
|
|
|
36 |
public post(endpoint: string, data: any): Observable<any> {
|
37 |
const url = `${this.apiUrl}/${endpoint}`;
|
38 |
const headers = this.getHeaders();
|
39 |
+
console.log('url post:', url); // To verify it's correct
|
40 |
return this.http.post(url, data, { headers });
|
41 |
}
|
42 |
|
src/app/features/home/chat/chat.component.html
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
<div class="d-flex">
|
17 |
<div><img src="../assets/images/robot.png" alt="" /></div>
|
18 |
<div class="flex-grow-1">
|
19 |
-
<h6>
|
20 |
<p [class.active]="i === selectedChatIndex" [innerHTML]="formatResponse(chat.answerModel.content)">
|
21 |
</p>
|
22 |
<input type="text" class="form-control" [(ngModel)]="chat.userTypedMessage"
|
|
|
16 |
<div class="d-flex">
|
17 |
<div><img src="../assets/images/robot.png" alt="" /></div>
|
18 |
<div class="flex-grow-1">
|
19 |
+
<h6>RegGPT</h6>
|
20 |
<p [class.active]="i === selectedChatIndex" [innerHTML]="formatResponse(chat.answerModel.content)">
|
21 |
</p>
|
22 |
<input type="text" class="form-control" [(ngModel)]="chat.userTypedMessage"
|
src/environments/environment.prod.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
export const environment = {
|
2 |
production: true,
|
3 |
-
identityServerURL: '
|
4 |
};
|
|
|
1 |
export const environment = {
|
2 |
production: true,
|
3 |
+
identityServerURL: 'https://ironone-ai-labs-reggpt-back-end.hf.space/api/v1',
|
4 |
};
|
src/index.html
CHANGED
@@ -18,4 +18,4 @@
|
|
18 |
<app-root></app-root>
|
19 |
</body>
|
20 |
|
21 |
-
</html>
|
|
|
18 |
<app-root></app-root>
|
19 |
</body>
|
20 |
|
21 |
+
</html>
|