You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the below error while deploying the front end code To Reproduce
Steps to reproduce the behavior:
I followed the below steps from
3. Prepare and run the frontend app for web UI (in folder web-app-frontend)
Go to web-app-frontend directory and run npm install -all to install dependencies.
Update “package.json” as following. Set value of “proxy” depending on where your Express.js backend is running.
Start frontend web app by running ‘npm start’
If Express.js backend “ai-app-backend” running on local machine then use "proxy": "http://localhost:8080"
If Express.js backend “ai-app-backend”running on Azure. Use "proxy": https://<>.azurewebsites.net
Open a browser and go to http://localhost:3000 to access the app.
Expected behavior
Front end should be up and running.
Screenshots
But I am getting below error
Desktop (please complete the following information):
OS: [e.g. window 11]
Browser [e.g. chrome]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
I made one change in App.js to resolve the name undefined error for getGPT3CustomPromptCompletion and the updated script is as follows
`import React, { Component } from 'react';
import { Container } from 'reactstrap';
//import axios from 'axios';
import { getGPT3ParseExtractInfo, getGPT3CustomPromptCompletion, getGPT3Summarize, getKeyPhrases, getTokenOrRefresh } from './token_util.js';
import { ResultReason } from 'microsoft-cognitiveservices-speech-sdk';
import './App.css';
//import { Input } from '@material-ui/core';
import BatchPage from './batchPage.js';
const speechsdk = require('microsoft-cognitiveservices-speech-sdk')
var recognizer;
export default class App extends Component {
constructor(props) {
super(props);
handleSubmit(event) {
alert('Your conversation will be saved with name : ' + this.state.value + ' Submit a different name to change it.');
event.preventDefault();
}
### Please help soon..
Getting the below error while deploying the front end code
To Reproduce
Steps to reproduce the behavior:
I followed the below steps from
3. Prepare and run the frontend app for web UI (in folder web-app-frontend)
Go to web-app-frontend directory and run npm install -all to install dependencies.
Update “package.json” as following. Set value of “proxy” depending on where your Express.js backend is running.
Start frontend web app by running ‘npm start’
If Express.js backend “ai-app-backend” running on local machine then use "proxy": "http://localhost:8080"
If Express.js backend “ai-app-backend”running on Azure. Use "proxy": https://<>.azurewebsites.net
Open a browser and go to http://localhost:3000 to access the app.
Expected behavior
Front end should be up and running.
Screenshots
But I am getting below error
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
I made one change in App.js to resolve the name undefined error for getGPT3CustomPromptCompletion and the updated script is as follows
`import React, { Component } from 'react';
import { Container } from 'reactstrap';
//import axios from 'axios';
import { getGPT3ParseExtractInfo, getGPT3CustomPromptCompletion, getGPT3Summarize, getKeyPhrases, getTokenOrRefresh } from './token_util.js';
import { ResultReason } from 'microsoft-cognitiveservices-speech-sdk';
import './App.css';
//import { Input } from '@material-ui/core';
import BatchPage from './batchPage.js';
const speechsdk = require('microsoft-cognitiveservices-speech-sdk')
var recognizer;
export default class App extends Component {
constructor(props) {
super(props);
}
handleToggle = () => {
this.setState(prevState => ({
showBatchPage: !prevState.showBatchPage,
}));
};
handleWindowClick = (windowName) => {
this.setState({ activeWindow: windowName });
};
handleChange(event) {
this.setState({value: event.target.value});
alert('You have selected conversation category : ' + this.state.value );
}
handleSubmit(event) {
alert('Your conversation will be saved with name : ' + this.state.value + ' Submit a different name to change it.');
event.preventDefault();
}
async componentDidMount() {
// check for valid speech key/region
const tokenRes = await getTokenOrRefresh();
if (tokenRes.authToken === null) {
this.setState({
displayText: 'FATAL_ERROR amc: ' + tokenRes.error
});
}
}
async sttFromMic() {
const tokenObj = await getTokenOrRefresh();
const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region);
speechConfig.speechRecognitionLanguage = 'en-US';
}
async gptCustomPromptCompetion(inputText){
var customPromptText = document.getElementById("customPromptTextarea").value;
var transcriptInputForPmt = document.getElementById("transcriptTextarea").value;
//const gptObj = await getGPT3CustomPromptCompletion(inputText, customPromptText);
const gptObj = await getGPT3CustomPromptCompletion(transcriptInputForPmt, customPromptText);
const gptText = gptObj.data.text;
try{
this.setState({ gptCustomPrompt: gptText.replace("\n\n", "") });
}catch(error){
this.setState({ gptCustomPrompt: gptObj.data });
}
}
async gptCustomPromptCompetion2(inputText){
var customPromptText = document.getElementById("customPromptTextarea2").value;
var transcriptInputForPmt2 = document.getElementById("transcriptTextarea").value;
//const gptObj = await getGPT3CustomPromptCompletion(inputText, customPromptText);
const gptObj = await getGPT3CustomPromptCompletion(transcriptInputForPmt2, customPromptText);
const gptText = gptObj.data.text;
try{
this.setState({ gptCustomPrompt2: gptText.replace("\n\n", "") });
}catch(error){
this.setState({ gptCustomPrompt2: gptObj.data });
}
}
async gptSummarizeText(inputText){
var transcriptInputForSumr = document.getElementById("transcriptTextarea").value;
//const gptObj = await getGPT3Summarize(inputText);
const gptObj = await getGPT3Summarize(transcriptInputForSumr);
const gptText = gptObj.data.text;
//recognizer.stopContinuousRecognitionAsync();
this.setState({ gptSummaryText: gptText.replace("\n\n", "") });
}
async stopRecording(){
recognizer.stopContinuousRecognitionAsync();
}
async gptParseExtractInfo(inputText){
var selectConvScenario = document.getElementById("formSelectConvScenario");
var convScenario = selectConvScenario.options[selectConvScenario.selectedIndex].text;
var transcriptInputToExtract = document.getElementById("transcriptTextarea").value;
const gptObj = await getGPT3ParseExtractInfo(transcriptInputToExtract, convScenario);
//const gptObj = await getGPT3ParseExtractInfo(inputText, convScenario);
const gptText = gptObj.data.text;
this.setState({ gptExtractedInfo: gptText.replace("\n\n", "") });
}
render() {
let pageComponent = null;
}
}`
The text was updated successfully, but these errors were encountered: