fix: edit user password optional
This commit is contained in:
@@ -74,7 +74,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
const systemList = systemMessage
|
||||
? [{ role: 'system', content: systemMessage }]
|
||||
: [];
|
||||
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\n\nasync function main(){\nconst params = ${JSON.stringify(
|
||||
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\n\nasync function main(){\n const params = ${JSON.stringify(
|
||||
{
|
||||
...parameters,
|
||||
messages: [
|
||||
@@ -85,8 +85,8 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
]
|
||||
},
|
||||
null,
|
||||
2
|
||||
)};\nconst chatCompletion = await openai.chat.completions.create(params);\n console.log(chatCompletion.choices[0]);\n}\nmain();`;
|
||||
4
|
||||
)};\nconst chatCompletion = await openai.chat.completions.create(params);\n console.log(chatCompletion.choices[0].message.content);\n}\nmain();`;
|
||||
setCodeValue(code);
|
||||
} else if (lang === 'python') {
|
||||
const formattedParams = _.keys(parameters).reduce(
|
||||
@@ -137,6 +137,9 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
minimap: {
|
||||
enabled: false
|
||||
},
|
||||
hover: {
|
||||
enabled: false
|
||||
},
|
||||
readOnly: true,
|
||||
formatOnType: true,
|
||||
formatOnPaste: true,
|
||||
|
||||
Reference in New Issue
Block a user