Skip to content

Commit

Permalink
Merge pull request #203 from tri-star/feature/add-gpt4-turbo
Browse files Browse the repository at this point in the history
Add gpt4-turbo model
  • Loading branch information
tri-star authored Apr 13, 2024
2 parents 326ad7b + 2974b51 commit 557d90d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v2.4.0

- Add gpt-4-turbo.

## v2.3.0

- Add gpt-4-0125-preview.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Your friend living in the sidebar, powered by OpenAI API(from gpt-3.5-turbo to gpt-4-0125-preview).
Your friend living in the sidebar, powered by OpenAI API(from gpt-3.5-turbo to gpt-4-turbo).
You can specify the model and temperature, and refer to conversation history(shared between Windows/WSL).

## Requirements
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"type": "git",
"url": "https://github.com/tri-star/side-buddy"
},
"version": "2.3.0",
"version": "2.4.0",
"engines": {
"vscode": "^1.78.0"
"vscode": "^1.88.0"
},
"categories": [
"Other"
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/api/open-ai/chat-api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ChatRequest } from '@/domain/chat'
import { DEFAULT_CHAT_MODEL, type ChatRequest } from '@/domain/chat'

/*
{
Expand Down Expand Up @@ -63,7 +63,7 @@ export async function fetchChatResponse(
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
model: DEFAULT_CHAT_MODEL,
messages: request.messages.map((message) => {
return {
role: message.role,
Expand Down
6 changes: 5 additions & 1 deletion packages/app/src/domain/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const roleSchema = zod.union([
])

export const modelSchema = zod.union([
zod.literal('gpt-4-turbo'),
zod.literal('gpt-4-0125-preview'),
zod.literal('gpt-4-1106-preview'),
zod.literal('gpt-4'),
Expand Down Expand Up @@ -40,11 +41,14 @@ export const chatRoles: ChatRole[] = ['system', 'assistant', 'user']
export type ChatModel = zod.infer<typeof modelSchema>

export const chatModels: ChatModel[] = [
'gpt-4-turbo',
'gpt-4-0125-preview',
'gpt-4-1106-preview',
'gpt-4-32k',
'gpt-4',
'gpt-3.5-turbo-1106',
'gpt-3.5-turbo-16k',
'gpt-3.5-turbo',
]
] as const

export const DEFAULT_CHAT_MODEL: ChatModel = 'gpt-4-turbo'

0 comments on commit 557d90d

Please sign in to comment.