firebase-gpt-chat-completion
Function for use of GPT Api for chat completion in Firebase
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.9%) to scientific vocabulary
Keywords
Repository
Function for use of GPT Api for chat completion in Firebase
Basic Info
Statistics
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Firebase Cloud Functions for GPT Chat Completion

Example of ChatGPT implementation in Firebase with functions. They are via internal calls with call and response. Issue:: This method seems to be slower than the other Stream method because it does not stream.
SETUP
In functions folder create file .env with your OpenAI Api key.
Sample:
text
OPEN_AI_KEY="sk-<your key here>"
SETUP WITH CUSTOM FUNCTIONS FOLDER
To use functions in a custom folder different from the default, suppose the destination folder is functions inside we create a new folder named gpt-chat-completion and copy files from this project that are inside the functions folder. Then edit the firebase.json file from the root folder of your project.
json
{
...
"firestore": {
...
},
...
"functions": [
{
"source": "functions/gpt-chat-completion",
"codebase": "gpt-chat-completion",
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"runtime": "nodejs16"
}
]
...
}
Deploy
Run firebase deploy --only functions:gpt-chat-completion
Sample usage in REACT
```javascript
import { httpsCallable } from "firebase/functions"; import { useFunctions, } from "reactfire"; ...
const functions = useFunctions(); const gptPrompt = httpsCallable(functions, "gptPrompt");
gptPrompt({prompt: [{role: "user", content: "Hello world"}]})
```
Owner
- Name: Anton Sychev
- Login: klich3
- Kind: user
- Location: Barcelona
- Company: @Sychev
- Website: https://sychev.xyz
- Twitter: too_klich3
- Repositories: 35
- Profile: https://github.com/klich3
FullStack developer passionate about decentralized web tech, AI, Web 2.0, FrontEnd/BackEnd, databases, and system optimization. Focused on R&D.
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: gpt-chat-completion
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Anton
family-names: Sychev
email: anton@sychev.xyz
repository-code: 'https://github.com/klich3/firebase-gpt-chat-completion.git'
abstract: GPT Chat Completion Cloud Functions for Firebase
keywords:
- gpt
- chatGPT
- firebase
- functions
license: MIT
version: 0.1.0
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- eslint ^8.40.0 development
- firebase-admin ^11.8.0
- firebase-functions ^4.4.0
- openai ^3.2.1