Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Chatgpt Puppeteer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Chatgpt Puppeteer
Commits
8f281c75
Commit
8f281c75
authored
Dec 04, 2022
by
Travis Fischer
Committed by
GitHub
Dec 04, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from ElijahPepe/feat/chatgpt-api-typings
parents
f9bdeba9
226b7d24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
245 additions
and
0 deletions
+245
-0
src/chatgpt-api-types.ts
src/chatgpt-api-types.ts
+244
-0
src/index.ts
src/index.ts
+1
-0
No files found.
src/chatgpt-api-types.ts
0 → 100644
View file @
8f281c75
/**
* https://chat.openapi.com/api/auth/session
*/
export
type
SessionResult
=
{
/**
* Object of the current user
*/
user
:
APIUser
/**
* ISO date of the expiration date of the access token
*/
expires
:
string
/**
* The access token
*/
accessToken
:
string
}
export
type
APIUser
=
{
/**
* ID of the user
*/
id
:
string
/**
* Name of the user
*/
name
:
string
/**
* Email of the user
*/
email
:
string
/**
* Image of the user
*/
image
:
string
/**
* Picture of the user
*/
picture
:
string
/**
* Groups the user is in
*/
groups
:
string
[]
|
[]
/**
* Features the user is in
*/
features
:
string
[]
|
[]
}
/**
* https://chat.openapi.com/backend-api/models
*/
export
type
ModelsResult
=
{
/**
* Array of models
*/
models
:
APIModel
[]
}
export
type
APIModel
=
{
/**
* Name of the model
*/
slug
:
string
/**
* Max tokens of the model
*/
max_tokens
:
number
/**
* Whether or not the model is special
*/
is_special
:
boolean
}
/**
* https://chat.openapi.com/backend-api/moderations
*/
export
type
ModerationsJSONBody
=
{
/**
* Input for the moderation decision
*/
input
:
string
/**
* The model to use in the decision
*/
model
:
AvailableModerationModels
}
export
type
AvailableModerationModels
=
'
text-moderation-playground
'
/**
* https://chat.openapi.com/backend-api/moderations
*/
export
type
ModerationsJSONResult
=
{
/**
* Whether or not the input is flagged
*/
flagged
:
boolean
/**
* Whether or not the input is blocked
*/
blocked
:
boolean
/**
* The ID of the decision
*/
moderation_id
:
string
}
/**
* https://chat.openapi.com/backend-api/conversation
*/
export
type
ConversationJSONBody
=
{
/**
* The action to take
*/
action
:
string
/**
* The ID of the conversation
*/
conversation_id
?:
string
/**
* Prompts to provide
*/
messages
:
APIPrompt
[]
/**
* The model to use
*/
model
:
string
/**
* The parent message ID
*/
parent_message_id
:
string
}
export
type
APIPrompt
=
{
/**
* The content of the prompt
*/
content
:
APIPromptContent
/**
* The ID of the prompt
*/
id
:
string
/**
* The role played in the prompt
*/
role
:
APIPromptRole
}
export
type
APIPromptContent
=
{
/**
* The content type of the prompt
*/
content_type
:
APIPromptContentType
/**
* The parts to the prompt
*/
parts
:
string
[]
}
export
type
APIPromptContentType
=
'
text
'
export
type
APIPromptRole
=
'
user
'
/**
* https://chat.openapi.com/backend-api/conversation/message_feedback
*/
export
type
MessageFeedbackJSONBody
=
{
/**
* The ID of the conversation
*/
conversation_id
:
string
/**
* The message ID
*/
message_id
:
string
/**
* The rating
*/
rating
:
APIMessageFeedbackRating
/**
* Tags to give the rating
*/
tags
?:
APIMessageFeedbackTags
[]
/**
* The text to include
*/
text
?:
string
}
export
type
APIMessageFeedbackTags
=
'
harmful
'
|
'
false
'
|
'
not-helpful
'
export
type
MessageFeedbackResult
=
{
/**
* The message ID
*/
message_id
:
string
/**
* The ID of the conversation
*/
conversation_id
:
string
/**
* The ID of the user
*/
user_id
:
string
/**
* The rating
*/
rating
:
APIMessageFeedbackRating
/**
* The text the server received, including tags
*/
text
?:
string
}
export
type
APIMessageFeedbackRating
=
'
thumbsUp
'
|
'
thumbsDown
'
src/index.ts
View file @
8f281c75
export
*
from
'
./chatgpt-api
'
export
*
from
'
./chatgpt-api-types
'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment