ozgrozer/chatgpt-artifacts
소개
Claude의 Artifacts 기능을 ChatGPT에 제공합니다.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalchatgpt-artifacts
Bring Claude's Artifacts feature to ChatGPT
Preview
https://github.com/ozgrozer/chatgpt-artifacts/assets/651938/abc68e48-2a85-4cb8-a17a-ae795de1ed26
Usage
Clone this repository
git clone https://github.com/ozgrozer/chatgpt-artifacts.git
Install dependencies
npm install
Duplicate .env.example as .env and add your OPEN AI API key
cp .env.example .env
vim .env
Build the app
npm run build
Start the app
npm start
Ollama Support
To make it work with your local LLMs like Llama3 or Gemma2 you just need to make a simple update in the code.
Open /pages/api/chat.js file
// change this
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY
})
// to this
const openai = new OpenAI({
apiKey: 'ollama',
baseURL: 'http://127.0.0.1:11434/v1'
})
// change this
const stream = await openai.chat.completions.create({
stream: true,
model: 'gpt-4o',
messages: conversations[conversationId]
})
// to this
const stream = await openai.chat.completions.create({
stream: true,
model: 'llama3',
messages: conversations[conversationId]
})
Groq Support
To make it work with Groq you just need to get an API key here and make a simple update in the code.
Open /pages/api/chat.js file
// change this
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY
})
// to this
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: 'https://api.groq.com/openai/v1'
})
// change this
const stream = await openai.chat.completions.create({
stream: true,
model: 'gpt-4o',
messages: conversations[conversationId]
})
// to this
const stream = await openai.chat.completions.create({
stream: true,
model: 'llama3-70b-8192',
messages: conversations[conversationId]
})
Azure OpenAI Support
To make it work with Azure OpenAI, you need to create a resource in the Azure Portal and then create a deployment in the Azure OpenAI Studio and get your API key, API version, API endpoint and make a simple update in the code.
Open /pages/api/chat.js file
// change this
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY
})
// to this (change the API version if yours is different)
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
defaultQuery: { 'api-version': '2023-03-15-preview' },
defaultHeaders: { 'api-key': process.env.OPENAI_API_KEY },
baseURL: 'https://<RESOURCE_NAME>.openai.azure.com/openai/deployments/<DEPLOYMENT_NAME>'
})
// change your model here
const stream = await openai.chat.completions.create({
stream: true,
model: 'gpt-4o',
messages: conversations[conversationId]
})
License
관련 프로젝트 살펴보기
불러오는 중…