generated from obsidianmd/obsidian-sample-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add gpt-3.5-turbo-instruct, gpt-4-32k, and gpt-3.5-turbo-16k
- Loading branch information
1 parent
fed4734
commit f6cc31a
Showing
12 changed files
with
233 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { ChatAdapter } from 'src/types' | ||
|
||
const OpenAIModelChatAdapter: ChatAdapter = { | ||
name: 'openai', | ||
engine: 'chat', | ||
endpoint: '/v1/chat/completions' | ||
} | ||
|
||
export default OpenAIModelChatAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { ChatAdapter } from 'src/types' | ||
|
||
const OpenAIModelCompletionAdapter: ChatAdapter = { | ||
name: 'openai', | ||
engine: 'completion', | ||
endpoint: '/v1/completions' | ||
} | ||
|
||
export default OpenAIModelCompletionAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import OpenAIModelChatAdapter from '../adapters/chat' | ||
|
||
import type { ModelDefinition } from '../types' | ||
|
||
const GPT35Turbo16K: ModelDefinition = { | ||
name: 'GPT-3.5 Turbo 16K', | ||
adapter: OpenAIModelChatAdapter, | ||
model: 'gpt-3.5-turbo-16k', | ||
maxTokens: 16385, | ||
tokenType: 'gpt4' | ||
} | ||
|
||
export default GPT35Turbo16K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import OpenAIModelCompletionAdapter from '../adapters/completion' | ||
|
||
import type { ModelDefinition } from '../types' | ||
|
||
const GPT35TurboInstruct: ModelDefinition = { | ||
name: 'GPT-3.5 Turbo Instruct', | ||
adapter: OpenAIModelCompletionAdapter, | ||
model: 'gpt-3.5-turbo-instruct', | ||
maxTokens: 8192, | ||
tokenType: 'gpt4' | ||
} | ||
|
||
export default GPT35TurboInstruct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import OpenAIModelChatAdapter from '../adapters/chat' | ||
|
||
import type { ModelDefinition } from '../types' | ||
|
||
const GPT432K: ModelDefinition = { | ||
name: 'GPT-4 32K', | ||
adapter: OpenAIModelChatAdapter, | ||
model: 'gpt-4-32k', | ||
maxTokens: 32768, | ||
tokenType: 'gpt4' | ||
} | ||
|
||
export default GPT432K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import GPT35Turbo from './gpt-3.5-turbo' | ||
import GPT35TurboInstruct from './gpt-3.5-turbo-instruct' | ||
import GPT35Turbo16K from './gpt-3.5-turbo-16k' | ||
import GPT4 from './gpt-4' | ||
import GPT432K from './gpt-4-32k' | ||
|
||
const models = { | ||
'gpt-4': GPT4, | ||
'gpt-3.5-turbo': GPT35Turbo | ||
'gpt-3.5-turbo': GPT35Turbo, | ||
'gpt-3.5-turbo-instruct': GPT35TurboInstruct, | ||
'gpt-3.5-turbo-16k': GPT35Turbo16K, | ||
'gpt-4-32k': GPT432K | ||
} | ||
|
||
export default models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.