"font-awesome": "*"
}
},
+ "font-awesome": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmmirror.com/font-awesome/-/font-awesome-4.7.0.tgz",
+ "integrity": "sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg=="
+ },
"ansi-align": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/ansi-align/download/ansi-align-3.0.0.tgz",
"logLevel": "debug",
"changeOrigin": true
},
- "/api/usecaseui-intent-analysis/v1": {
- "target": "https://192.168.235.25:30283",
+ "/api/usecaseui-intent-analysis/v1": {
+ "target": "http://localhost:8083",
+ "secure": false,
+ "logLevel": "debug",
+ "changeOrigin": true
+ },
+ "/api/usecaseui-llm-adaptation/v1": {
+ "target": "http://localhost:8084",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
import { OrderServiceComponent } from './views/services/sotn-management/order-service/order-service.component';
import { SotnManagementComponent } from './views/services/sotn-management/sotn-management.component';
import { IntentManagementComponent } from './views/intent-management/intent-management.component';
+import { RobotComponent } from './views/robot/robot.component';
{ path: 'network/ccvpn-network', component: CcvpnNetworkComponent },
{ path: 'network/mdons-network', component: MdonsNetworkComponent },
{ path: 'intent-management', component:IntentManagementComponent},
- { path: '**', redirectTo: 'home', pathMatch: 'full' }
+ { path: 'robot', component: RobotComponent }
+ //{ path: '**', redirectTo: 'home', pathMatch: 'full' }
];
@NgModule({
<span>{{"i18nTextDefine_IntentManagement" | translate}} </span>
</span>
</a>
+ </li>
+ <!-- robot -->
+ <li nz-menu-item [ngClass]="{'activeMenuBar': url === 'robot'}">
+ <a routerLink="robot">
+ <span title>
+ <i>
+ <img
+ src="{{url === 'robot' ? 'assets/images/robot-active.png':'assets/images/robot-hui.png'}}"
+ alt="home">
+ </i>
+ <span>{{"i18nTextDefine_robot" | translate}} </span>
+ </span>
+ </a>
</li>
<hr>
</ul>
import { InputIntentConditionComponent } from './views/intent-management/input-intent-condition/input-intent-condition.component';
import { IntentReportDetailComponent } from './views/intent-management/intent-report-detail/intent-report-detail.component';
import { AngularDateTimePickerModule } from 'angular2-datetimepicker';
+import { RobotComponent } from './views/robot/robot.component';
export function HttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, "./assets/i18n/", ".json");
InputIntentStateComponent,
InputIntentConditionComponent,
IntentReportDetailComponent,
+ RobotComponent
],
imports: [
BrowserModule,
--- /dev/null
+<body >
+<div class="chat-container">
+ <div *ngFor="let chat of chatHistory">
+ <div class="question">
+ <img src="assets/images/user.png">
+ <span>{{ chat.question }}</span>
+ </div>
+ <br>
+ <div class="answer"><img src="assets/images/answer.png">
+ <span>{{ chat.answer }}</span>
+ </div>
+ <br>
+ </div>
+</div>
+<div class="input-wrapper">
+ <textarea nz-tooltip nz-input [nzAutosize]="{ minRows: 2, maxRows: 2 }" [(ngModel)]="question" class="text-input"></textarea>
+ <i class="icon" (click)="submitQuestion()">
+ <img src="assets/images/send.png">
+ </i>
+</div>
+</body>
\ No newline at end of file
--- /dev/null
+body {
+ background-color: #e6e6fa;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+}
+.chat-container {
+ margin: 20px 0;
+ padding: 0 100px;
+}
+.question {
+ display: flex;
+}
+.record-input{
+ margin-left: 10px;
+ resize: none;
+}
+.question span {
+ background-color: white;
+ font-size: 16px;
+ margin-left: 10px;
+ padding: 10px;
+ border-radius: 8px;
+}
+.question img {
+ width: 28px;
+ height: 28px;
+}
+
+.answer {
+ display: flex;
+}
+.answer span{
+ background-color: white;
+ font-size: 16px;
+ margin-left: 10px;
+ padding: 10px;
+ border-radius: 8px;
+ white-space: pre-line;
+}
+.answer img {
+ width: 28px;
+ height: 28px;
+}
+
+.chat-input {
+ margin-top: 30px;
+ padding-left: 1100px;
+}
+
+.input-wrapper {
+ display: flex;
+ justify-content: space-around;
+ width: e("calc(100% - 240px)");
+ margin: 0 100px;
+ margin-left: 138px;
+ padding: 10px;
+ background: #fff;
+ border-radius: 8px;
+ border: 2px solid #8a2be2;
+}
+
+.text-input {
+ width: e("calc(100% - 50px)");
+ background-color: white;
+ color: black;
+ text-align: left;
+ border: 0;
+ resize: none;
+
+ &:focus {
+ border: 0 !important;
+ box-shadow: none;
+ }
+}
+
+.icon {
+ width: 50px;
+ height: 50px;
+ cursor: pointer;
+
+ >img {
+ width: 35px;
+ height: 31px;
+ margin-top: 15px;
+ margin-left: 15px;
+ }
+}
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd';
+import { HttpClient } from '@angular/common/http';
+
+@Component({
+ selector: 'app-robot',
+ templateUrl: './robot.component.html',
+ styleUrls: ['./robot.component.less']
+})
+export class RobotComponent implements OnInit {
+
+ question: string;
+ communicationMessage: string;
+ chatHistory: { question: string, answer: string }[] = [];
+ apiUrl = '/api/usecaseui-llm-adaptation/v1/getHelper';
+
+ constructor(
+ private http: HttpClient,
+ private message: NzMessageService
+ ) { }
+ ngOnInit() {}
+
+ submitQuestion() {
+ this.http.post<any>(this.apiUrl,this.question,{ responseType: 'text' as 'json'}).subscribe((data) => {
+ if(data==''){
+ this.chatHistory.push({ question: this.question, answer: 'network error' });
+ }else{
+ this.chatHistory.push({ question: this.question, answer: data });
+ }
+ this.question = '';
+ }, error => {
+ this.message.error('error');
+ });
+ }
+}
"i18nTextDefine_ExternalNetworkMessage":"注意:两个端点都将更改为ENNI。",
"i18nTextDefine_exportData": "导出",
"i18nTextDefine_startTime": "起始时间",
- "i18nTextDefine_endTime": "终止时间"
+ "i18nTextDefine_endTime": "终止时间",
+ "i18nTextDefine_robot": "大模型"
}
"i18nTextDefine_Size":"Size",
"i18nTextDefine_exportData": "Export Data",
"i18nTextDefine_startTime": "Start Time",
- "i18nTextDefine_endTime": "End Time"
+ "i18nTextDefine_endTime": "End Time",
+ "i18nTextDefine_robot": "Large Model"
}