Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint style structure and more customize of all model. #142

Merged
merged 107 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
6db4457
feat: show toneStyle in conversation title bar
wtlyu Mar 30, 2023
6fb32dd
feat: new endpoint-style structure in server side
wtlyu Mar 30, 2023
5d733c8
feat: new endpoint-style structure in client side
wtlyu Mar 30, 2023
11ae972
fix: a typo in authenticatedOrRedirect
wtlyu Mar 30, 2023
82e8ac4
feat: new endpoint-style icon
wtlyu Mar 30, 2023
f484524
feat: feat: new endpoint-style submit
wtlyu Mar 30, 2023
45abd4c
feat: feat: new endpoint-style endpoint select
wtlyu Mar 30, 2023
3eef3c8
feat: bingstyles now support endpoint
wtlyu Mar 30, 2023
3f0c07c
fix: suggestions seems not used. what's this?
wtlyu Mar 30, 2023
5a366f5
remove yarn.lock
wtlyu Mar 30, 2023
56c669a
feat: view endpoint setting in message header.
wtlyu Mar 31, 2023
02b7ed8
fix: jailbreak should be boolean
wtlyu Mar 31, 2023
b130b3f
refactor(BingStyles.jsx): use cn utility function to concatenate clas…
danny-avila Mar 31, 2023
b4d0660
feat: prototype of endpoint setting
wtlyu Mar 31, 2023
af48947
feat: add animation
wtlyu Mar 31, 2023
ee45b12
feat: select model
wtlyu Mar 31, 2023
aaa6818
feat: select options
danny-avila Mar 31, 2023
ee0f075
feat: support copy to clipboard
wtlyu Mar 31, 2023
00cf4ca
clean: parentMassageId is no more needed in conversation.
wtlyu Mar 31, 2023
6a31e84
fix : endpoint option should hide on exist conversation
wtlyu Mar 31, 2023
0094bd9
basic settings done for openAI
danny-avila Mar 31, 2023
86eb0ae
merge latest
danny-avila Mar 31, 2023
a981050
reset package-lock
danny-avila Mar 31, 2023
9af1eff
refactor(OptionHover.jsx): simplify types object by removing unnecess…
danny-avila Mar 31, 2023
95ba8e8
update more button and misc. styling
danny-avila Mar 31, 2023
4d4d8b7
fix(Settings.jsx): change min value of Slider component to -2 to allo…
danny-avila Apr 1, 2023
7240a85
style(Settings.jsx): remove unnecessary line break
danny-avila Apr 1, 2023
8c5e69e
style(Input/OpenAIOptions): comment out unused code and add gray colo…
danny-avila Apr 1, 2023
f56f900
style(OpenAIOptions): add dark mode support to Settings2 icon
danny-avila Apr 1, 2023
0fa80b8
feat: return endpoint config from server
wtlyu Apr 1, 2023
2cfae39
feat: advanced style for openAI endpoint
wtlyu Apr 1, 2023
8c53d50
feat: endpoint setting mobile style.
wtlyu Apr 1, 2023
4f4381a
feat: add default text.
wtlyu Apr 1, 2023
9def051
feat: move EndpointOptionsPopover as a common component
wtlyu Apr 1, 2023
9cb211e
complete: modeldropdown
danny-avila Apr 1, 2023
f48bdd1
Merge branch 'feat-endpoint-style-structure' of https://github.com/da…
danny-avila Apr 1, 2023
2b56afa
code cleanup
wtlyu Apr 1, 2023
a6ea3a6
style(ui): replace SaveIcon with Save from lucide-react in EndpointOp…
danny-avila Apr 1, 2023
5ddc25e
Merge branch 'feat-endpoint-style-structure' of https://github.com/da…
danny-avila Apr 1, 2023
14b62c6
feat(ModelDropDown.jsx): add optional props to customize component ap…
danny-avila Apr 1, 2023
ea8e415
feat: add preset in server
wtlyu Apr 1, 2023
3b8d1af
feat: add preset and edit preset.
wtlyu Apr 1, 2023
d910acf
merge Daniel Avila's commit
wtlyu Apr 1, 2023
d05b5a5
fix: change endpoint should not skip when endpoint same
wtlyu Apr 1, 2023
dcf63ce
Merge branch 'master' of https://github.com/danny-avila/chatgpt-clone…
danny-avila Apr 1, 2023
2ae9201
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 1, 2023
587601e
fix: add brackets to main property for dialogtemplate
danny-avila Apr 1, 2023
6d11d61
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 2, 2023
969980d
reset package-lock
danny-avila Apr 2, 2023
1c0ab50
refactor(ModelDropDown.jsx): remove commented out code and simplify m…
danny-avila Apr 2, 2023
c9caa2d
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 2, 2023
23293bf
feat(chatgpt-browser): add support for multiple GPT models
danny-avila Apr 2, 2023
60968b3
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 2, 2023
a0f2cbe
refactor(getIcon.jsx): if model is GPT-4, change background color to …
danny-avila Apr 2, 2023
dd65c09
feat(client): add @radix-ui/react-checkbox dependency and create Bing…
danny-avila Apr 2, 2023
6f74eea
feat: export preset.
wtlyu Apr 3, 2023
bfc4543
fix: proxy auth in vite.config.js
wtlyu Apr 3, 2023
4ef8665
fix: regenerate should work for error message.
wtlyu Apr 3, 2023
78c00ea
fix: bingAI/settings: wrong usage of checkbox
wtlyu Apr 3, 2023
4e429f1
server fix: code refactor
wtlyu Apr 3, 2023
e4a4426
feat: support edit preset,
wtlyu Apr 3, 2023
335cc7d
feat: open option dialog when click messageHeader
wtlyu Apr 3, 2023
bd426ac
feat: preserve the title of preset.
wtlyu Apr 3, 2023
37e41c1
reset package-lock on root dir
danny-avila Apr 3, 2023
de3272f
reset package-lock files
danny-avila Apr 3, 2023
a9f8568
chore(Settings.jsx): comment out unused import of InputNumber component
danny-avila Apr 3, 2023
9c3e1b0
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 3, 2023
ba39e01
feat(bing-settings): Work in Progress, will finish tomorrow
danny-avila Apr 4, 2023
04a8a8c
refactor: code clean up
wtlyu Apr 4, 2023
d9589e1
style: show scrollbar over content.
wtlyu Apr 4, 2023
d1296ee
fix: cannot open edit preset the use preset.
wtlyu Apr 4, 2023
31ddc2a
feat: count tokens for context
danny-avila Apr 4, 2023
fe9724b
style(tokenizer.js): comment out console.log statement
danny-avila Apr 4, 2023
d7aa886
Merge branch 'feat-endpoint-style-structure' of https://github.com/da…
danny-avila Apr 4, 2023
da8dade
Add esbuild to package.json
danorlando Apr 4, 2023
0288ae5
feat(bingai.js): add context and systemMessage parameters to askBing …
danny-avila Apr 4, 2023
2743d5e
Merge branch 'feat-endpoint-style-structure' of https://github.com/da…
danny-avila Apr 4, 2023
2dce6bd
fix: rewrite ask openAI and ask BingAI. now all code cleaned.
wtlyu Apr 4, 2023
8259453
fix: to set default value when change endpoint of preset
wtlyu Apr 4, 2023
45fb360
fix: use universal setToneStyle
wtlyu Apr 4, 2023
4989ee6
code clean.
wtlyu Apr 4, 2023
4ddc3a2
feat: add jailbreak option for bingai
wtlyu Apr 4, 2023
c4b3b41
feat: style match
wtlyu Apr 4, 2023
fdb3903
feat: use default preset to create new conversation.
wtlyu Apr 4, 2023
cc358ab
feat: add confirm of clear all presets.
wtlyu Apr 4, 2023
9270142
change Switch to simple mode to close button
wtlyu Apr 4, 2023
d8e1fdd
refactor(askOpenAI.js): rename gptResponse to response, fixes titling…
danny-avila Apr 4, 2023
ad7368c
docs(bingai.js): remove commented example response and add reference …
danny-avila Apr 5, 2023
bbede0f
feat: Import Presets from NewConversationMenu
danny-avila Apr 5, 2023
d5a76c5
feat: remove customGpts
wtlyu Apr 5, 2023
05c4cbc
fix: validate the import preset
wtlyu Apr 5, 2023
5d141c2
fix: dont clear the input message if conversationId changed.
wtlyu Apr 5, 2023
bd14bc2
style: options in mobile
wtlyu Apr 5, 2023
954f51f
feat: range number input in options.
wtlyu Apr 5, 2023
ef9fa9f
fix: force reset to default if 0 or false
wtlyu Apr 5, 2023
a132b5c
feat: update env example.
wtlyu Apr 5, 2023
dda0b7f
fix: input style
wtlyu Apr 5, 2023
506326d
feat(client): add rc-input-number package to dependencies
danny-avila Apr 5, 2023
3d6361f
style(MessageHeader.jsx): add hover opacity to the background color o…
danny-avila Apr 5, 2023
0607bc1
fix: typo in askBingAI.js
wtlyu Apr 5, 2023
2503fa5
style(Settings.jsx): add openDelay prop for faster HoverCard views
danny-avila Apr 5, 2023
f6d7c61
feat(client): add doubleClickHandler prop to Slider component to rese…
danny-avila Apr 5, 2023
aded994
fix(ui): change SelectDropdown to SelectDropDown in multiple files
danny-avila Apr 5, 2023
07c439f
feat: add delete for presets in menu
danny-avila Apr 5, 2023
73fa5c9
fix: lost model of browser
wtlyu Apr 5, 2023
ca35989
fix: remove messageHeader click when endpoint is browser
danny-avila Apr 5, 2023
f8f4b2d
Merge branch 'main' into feat-endpoint-style-structure
danny-avila Apr 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 57 additions & 56 deletions LOCAL_INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,82 @@
### Local

- **Install the prerequisites**
- **Download chatgpt-clone**
- Download the latest release here: https://github.com/danny-avila/chatgpt-clone/releases/
- Or by clicking on the green code button in the top of the page and selecting "Download ZIP"
- Or (Recommended if you have Git installed) pull the latest release from the main branch
- If you downloaded a zip file, extract the content in "C:/chatgpt-clone/"
-**IMPORTANT : If you install the files somewhere else modify the instructions accordingly**

- **To enable the Conversation search feature:**
-IF YOU DON'T WANT THIS FEATURE YOU CAN SKIP THIS STEP
- Download MeileSearch latest release from : https://github.com/meilisearch/meilisearch/releases
- Copy it to "C:/chatgpt-clone/"
- Rename the file to "meilisearch.exe"
- Open it by double clicking on it
- Copy the generated Master Key and save it somewhere (You will need it later)

- **Download and Install Node.js**
- Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.)

- **Create a MongoDB database**
- Navigate to https://www.mongodb.com/ and Sign In or Create an account
- Create a new project
- Build a Database using the free plan and name the cluster (example: chatgpt-clone)
- Use the "Username and Password" method for authentication
- Add your current IP to the access list
- Then in the Database Deployment tab click on Connect
- In "Choose a connection method" select "Connect your application"
- Driver = Node.js / Version = 4.1 or later
- Copy the connection string and save it somewhere(you will need it later)

- **Get your OpenAI API key** here: https://platform.openai.com/account/api-keys and save it somewhere safe (you will need it later)

- **Get your Bing Access Token**
- Using MS Edge, navigate to bing.com
- Make sure you are logged in
- Open the DevTools by pressing F12 on your keyboard
- Click on the tab "Application" (On the left of the DevTools)
- Expand the "Cookies" (Under "Storage")
- You need to copy the value of the "_U" cookie, save it somewhere, you will need it later


- **Download chatgpt-clone**
- Download the latest release here: https://github.com/danny-avila/chatgpt-clone/releases/
- Or by clicking on the green code button in the top of the page and selecting "Download ZIP"
- Or (Recommended if you have Git installed) pull the latest release from the main branch
- If you downloaded a zip file, extract the content in "C:/chatgpt-clone/" -**IMPORTANT : If you install the files somewhere else modify the instructions accordingly**
- **To enable the Conversation search feature:**
-IF YOU DON'T WANT THIS FEATURE YOU CAN SKIP THIS STEP

- Download MeileSearch latest release from : https://github.com/meilisearch/meilisearch/releases
- Copy it to "C:/chatgpt-clone/"
- Rename the file to "meilisearch.exe"
- Open it by double clicking on it
- Copy the generated Master Key and save it somewhere (You will need it later)

- **Download and Install Node.js**
- Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.)
- **Create a MongoDB database**
- Navigate to https://www.mongodb.com/ and Sign In or Create an account
- Create a new project
- Build a Database using the free plan and name the cluster (example: chatgpt-clone)
- Use the "Username and Password" method for authentication
- Add your current IP to the access list
- Then in the Database Deployment tab click on Connect
- In "Choose a connection method" select "Connect your application"
- Driver = Node.js / Version = 4.1 or later
- Copy the connection string and save it somewhere(you will need it later)
- **Get your OpenAI API key** here: https://platform.openai.com/account/api-keys and save it somewhere safe (you will need it later)

- **Get your Bing Access Token**
- Using MS Edge, navigate to bing.com
- Make sure you are logged in
- Open the DevTools by pressing F12 on your keyboard
- Click on the tab "Application" (On the left of the DevTools)
- Expand the "Cookies" (Under "Storage")
- You need to copy the value of the "\_U" cookie, save it somewhere, you will need it later

- **Create the ".env" File** You will need all your credentials, (API keys, access tokens, and Mongo Connection String, MeileSearch Master Key)
- Open "C:/chatgpt-clone/api/.env.example" in a text editor
- At this line **MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"**
Replace mongodb://127.0.0.1:27017/chatgpt-clone with the MondoDB connection string you saved earlier, **remove "&w=majority" at the end**
- It should look something like this: "MONGO_URI="mongodb+srv://username:[email protected]/?retryWrites=true"
- At this line **OPENAI_KEY=** you need to add your openai API key
- Add your Bing token to this line **BING_TOKEN=** (needed for BingChat & Sydney)
- If you want to enable Search, **SEARCH=TRUE** if you do not want to enable search **SEARCH=FALSE**
- Add your previously saved MeiliSearch Master key to this line **MEILI_MASTER_KEY=** (the key is needed if search is enabled even on local install or you may encounter errors)
- Save the file as **"C:/chatgpt-clone/api/.env"**
- Open "C:/chatgpt-clone/api/.env.example" in a text editor
- At this line **MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"**
Replace mongodb://127.0.0.1:27017/chatgpt-clone with the MondoDB connection string you saved earlier, **remove "&w=majority" at the end**
- It should look something like this: "MONGO_URI="mongodb+srv://username:[email protected]/?retryWrites=true"
- At this line **OPENAI_KEY=** you need to add your openai API key
- Add your Bing token to this line **BINGAI_TOKEN=** (needed for BingChat & Sydney)
- If you want to enable Search, **SEARCH=TRUE** if you do not want to enable search **SEARCH=FALSE**
- Add your previously saved MeiliSearch Master key to this line **MEILI_MASTER_KEY=** (the key is needed if search is enabled even on local install or you may encounter errors)
- Save the file as **"C:/chatgpt-clone/api/.env"**

**DO THIS ONCE AFTER EVERY UPDATE**

- **Run** `npm ci` in the "C:/chatgpt-clone/api" directory
- **Run** `npm ci` in the "C:/chatgpt-clone/client" directory
- **Run** `npm run build` in the "C:/chatgpt-clone/client"

**DO THIS EVERY TIME YOU WANT TO START CHATGPT-CLONE**

- **Run** `"meilisearch --master-key put_your_meilesearch_Master_Key_here"` in the "C:/chatgpt-clone" directory (Only if SEARCH=TRUE)
- **Run** `npm start` in the "C:/chatgpt-clone/api" directory
- **Run** `npm start` in the "C:/chatgpt-clone/api" directory

- **Visit** http://localhost:3080 (default port) & enjoy


OPTIONAL BUT RECOMMENDED

- **Make a batch file to automate the starting process**
- Open a text editor
- Paste the following code in a new document
- Put your MeiliSearch master key instead of "your_master_key_goes_here"
- Save the file as "C:/chatgpt-clone/chatgpt-clone.bat"
- you can make a shortcut of this batch file and put it anywhere
- Open a text editor
- Paste the following code in a new document
- Put your MeiliSearch master key instead of "your_master_key_goes_here"
- Save the file as "C:/chatgpt-clone/chatgpt-clone.bat"
- you can make a shortcut of this batch file and put it anywhere

```
REM the meilisearch executable needs to be at the root of the chatgpt-clone directory

start "MeiliSearch" cmd /k "meilisearch --master-key your_master_key_goes_here

REM ↑↑↑ meilisearch is the name of the meilisearch executable, put your own master key there
REM ↑↑↑ meilisearch is the name of the meilisearch executable, put your own master key there

start "ChatGPT-Clone" cmd /k "cd api && npm start"

Expand Down
73 changes: 55 additions & 18 deletions api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,68 @@ NODE_ENV=development
# Change this to your MongoDB URI if different and I recommend appending chatgpt-clone
MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"

# API key configuration.
# Leave blank if you don't want them.

#############################
# Endpoint OpenAI:
#############################

# Access key from OpenAI platform
# Leave it blank to disable this endpoint
OPENAI_KEY=

# Default ChatGPT API Model, options: 'gpt-4', 'text-davinci-003', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0301'
# you will have errors if you don't have access to a model like 'gpt-4', defaults to turbo if left empty/excluded.
DEFAULT_API_GPT=gpt-3.5-turbo
# Identify the available models, sperate by comma, and not space in it
# Leave it blank to use internal settings.
# OPENAI_MODELS=gpt-4,text-davinci-003,gpt-3.5-turbo,gpt-3.5-turbo-0301

# Reverse proxy setting for OpenAI
# https://github.com/waylaidwanderer/node-chatgpt-api#using-a-reverse-proxy
# OPENAI_REVERSE_PROXY=<YOUR REVERSE PROXY>


#############################
# Endpoint BingAI (Also jailbreak Sydney):
#############################

# BingAI Tokens: the "_U" cookies value from bing.com
# Leave it and BINGAI_USER_TOKEN blank to disable this endpoint.
BINGAI_TOKEN=

# BingAI User defined Token
# Allow user to set their own token by client
# Uncomment this to enable this feature.
# (Not implemented yet.)
# BINGAI_USER_TOKEN=1

# _U Cookies Value from bing.com
BING_TOKEN=

#############################
# Endpoint chatGPT:
#############################

# ChatGPT Browser Client (free but use at your own risk)
# Access token from https://chat.openai.com/api/auth/session
# Exposes your access token to a 3rd party
# Exposes your access token to CHATGPT_REVERSE_PROXY
# Leave it blank to disable this endpoint
CHATGPT_TOKEN=
# If you have access to other models on the official site, you can use them here.
# Defaults to 'text-davinci-002-render-sha' if left empty.
# options: gpt-4, text-davinci-002-render, text-davinci-002-render-paid, or text-davinci-002-render-sha
# You cannot use a model that your account does not have access to. You can check
# which ones you have access to by opening DevTools and going to the Network tab.
# Refresh the page and look at the response body for https://chat.openai.com/backend-api/models.
BROWSER_MODEL=

# Identify the available models, sperate by comma, and not space in it
# Leave it blank to use internal settings.
# CHATGPT_MODELS=text-davinci-002-render-sha,text-davinci-002-render-paid,gpt-4

# Reverse proxy setting for OpenAI
# https://github.com/waylaidwanderer/node-chatgpt-api#using-a-reverse-proxy
# By default it will use the node-chatgpt-api recommended proxy, (it's a third party server)
# CHATGPT_REVERSE_PROXY=<YOUR REVERSE PROXY>


#############################
# Search:
#############################

# ENABLING SEARCH MESSAGES/CONVOS
# Requires installation of free self-hosted Meilisearch or Paid Remote Plan (Remote not tested)
# The easiest setup for this is through docker-compose, which takes care of it for you.
# SEARCH=TRUE
SEARCH=TRUE
# SEARCH=1
SEARCH=1

# REQUIRED FOR SEARCH: MeiliSearch Host, mainly for api server to connect to the search server.
# must replace '0.0.0.0' with 'meilisearch' if serving meilisearch with docker-compose
Expand All @@ -63,8 +97,11 @@ MEILI_HTTP_ADDR='0.0.0.0:7700' # <-- local/remote
MEILI_MASTER_KEY=JKMW-hGc7v_D1FkJVdbRSDNFLZcUv3S75yrxXP0SmcU # <-- ready made secure key for docker-compose


#############################
# User System
# global enable/disable the sample user system.
#############################

# Enable the user system.
# this is not a ready to use user system.
# dont't use it, unless you can write your own code.
# ENABLE_USER_SYSTEM= # <-- make sure you don't comment this back in if you're not using your own user system
85 changes: 50 additions & 35 deletions api/app/clients/bingai.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,67 @@
require('dotenv').config();
const { KeyvFile } = require('keyv-file');

const askBing = async ({ text, onProgress, convo }) => {
const askBing = async ({
text,
parentMessageId,
conversationId,
jailbreak,
jailbreakConversationId,
context,
systemMessage,
conversationSignature,
clientId,
invocationId,
toneStyle,
onProgress
}) => {
const { BingAIClient } = await import('@waylaidwanderer/chatgpt-api');
const store = {
store: new KeyvFile({ filename: './data/cache.json' })
};

const bingAIClient = new BingAIClient({
// "_U" cookie from bing.com
userToken: process.env.BING_TOKEN,
userToken: process.env.BINGAI_TOKEN,
// If the above doesn't work, provide all your cookies as a string instead
// cookies: '',
debug: false,
cache: { store: new KeyvFile({ filename: './data/cache.json' }) },
cache: store,
proxy: process.env.PROXY || null
});

let options = { onProgress };
if (convo) {
options = { ...options, ...convo };
}
let options = {};

if (options?.jailbreakConversationId == 'false') {
options.jailbreakConversationId = false;
if (jailbreakConversationId == 'false') {
jailbreakConversationId = false;
}

if (convo.toneStyle) {
options.toneStyle = convo.toneStyle;
if (jailbreak)
options = {
jailbreakConversationId: jailbreakConversationId || jailbreak,
context,
systemMessage,
parentMessageId,
toneStyle,
onProgress
};
else {
options = {
conversationId,
context,
systemMessage,
parentMessageId,
toneStyle,
onProgress
};

// don't give those parameters for new conversation
// for new conversation, conversationSignature always is null
if (conversationSignature) {
options.conversationSignature = conversationSignature;
options.clientId = clientId;
options.invocationId = invocationId;
}
}

console.log('bing options', options);
Expand All @@ -33,30 +70,8 @@ const askBing = async ({ text, onProgress, convo }) => {

return res;

// Example response for reference
// {
// conversationSignature: 'wwZ2GC/qRgEqP3VSNIhbPGwtno5RcuBhzZFASOM+Sxg=',
// conversationId: '51D|BingProd|026D3A4017554DE6C446798144B6337F4D47D5B76E62A31F31D0B1D0A95ED868',
// clientId: '914800201536527',
// invocationId: 1,
// conversationExpiryTime: '2023-02-15T21:48:46.2892088Z',
// response: 'Hello, this is Bing. Nice to meet you. 😊',
// details: {
// text: 'Hello, this is Bing. Nice to meet you. 😊',
// author: 'bot',
// createdAt: '2023-02-15T15:48:43.0631898+00:00',
// timestamp: '2023-02-15T15:48:43.0631898+00:00',
// messageId: '9d0c9a80-91b1-49ab-b9b1-b457dc3fe247',
// requestId: '5b252ef8-4f09-4c08-b6f5-4499d2e12fba',
// offense: 'None',
// adaptiveCards: [ [Object] ],
// sourceAttributions: [],
// feedback: { tag: null, updatedOn: null, type: 'None' },
// contentOrigin: 'DeepLeo',
// privacy: null,
// suggestedResponses: [ [Object], [Object], [Object] ]
// }
// }
// for reference:
// https://github.com/waylaidwanderer/node-chatgpt-api/blob/main/demos/use-bing-client.js
};

module.exports = { askBing };
Loading