diff --git a/packages/ai-jsx/package.json b/packages/ai-jsx/package.json index d6a5066a..3cd66eb9 100644 --- a/packages/ai-jsx/package.json +++ b/packages/ai-jsx/package.json @@ -4,7 +4,7 @@ "repository": "fixie-ai/ai-jsx", "bugs": "https://github.com/fixie-ai/ai-jsx/issues", "homepage": "https://ai-jsx.com", - "version": "0.30.0", + "version": "0.30.1", "volta": { "extends": "../../package.json" }, diff --git a/packages/ai-jsx/src/lib/openai.tsx b/packages/ai-jsx/src/lib/openai.tsx index 17dcf6ce..5c97f2f6 100644 --- a/packages/ai-jsx/src/lib/openai.tsx +++ b/packages/ai-jsx/src/lib/openai.tsx @@ -25,30 +25,26 @@ import { getEncoding } from 'js-tiktoken'; import _ from 'lodash'; // https://platform.openai.com/docs/models/model-endpoint-compatibility -export type ValidCompletionModel = - | 'text-davinci-003' - | 'text-davinci-002' - | 'text-curie-001' - | 'text-babbage-001' - | 'text-ada-001' - | 'gpt-3.5-turbo-instruct'; +export type ValidCompletionModel = 'davinci-002' | 'babbage-002' | 'gpt-3.5-turbo-instruct'; +// curl 'https://api.openai.com/v1/models' -H "Authorization: Bearer $OPENAI_API_KEY" | jq -r '.data[] | .id' | sort | awk '/^gpt/ && !/vision/ && !/instruct/ { print "| \"" $0 "\"" }' export type ValidChatModel = - | 'gpt-4' - | 'gpt-4-0314' // discontinue on 06/13/2024 - | 'gpt-4-0613' - | 'gpt-4-32k' - | 'gpt-4-32k-0314' // discontinue on 06/13/2024 - | 'gpt-4-32k-0613' - | 'gpt-4-1106-preview' - | 'gpt-4-0125-preview' - | 'gpt-4-turbo-preview' | 'gpt-3.5-turbo' - | 'gpt-3.5-turbo-0301' // discontinue on 06/13/2024 + | 'gpt-3.5-turbo-0125' + | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' + | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-16k-0613' - | 'gpt-3.5-turbo-1106'; + | 'gpt-4' + | 'gpt-4-0125-preview' + | 'gpt-4-0613' + | 'gpt-4-1106-preview' + | 'gpt-4-32k' + | 'gpt-4-32k-0613' + | 'gpt-4-turbo' + | 'gpt-4-turbo-2024-04-09' + | 'gpt-4-turbo-preview'; /** * An OpenAI client that talks to the Azure OpenAI service. @@ -224,16 +220,16 @@ function tokenLimitForChatModel( switch (model) { case 'gpt-4': - case 'gpt-4-0314': case 'gpt-4-0613': return 8192 - functionEstimate - TOKENS_CONSUMED_BY_REPLY_PREFIX; case 'gpt-4-32k': - case 'gpt-4-32k-0314': case 'gpt-4-32k-0613': return 32768 - functionEstimate - TOKENS_CONSUMED_BY_REPLY_PREFIX; case 'gpt-4-1106-preview': case 'gpt-4-0125-preview': case 'gpt-4-turbo-preview': + case 'gpt-4-turbo-2024-04-09': + case 'gpt-4-turbo': return 128_000 - functionEstimate - TOKENS_CONSUMED_BY_REPLY_PREFIX; case 'gpt-3.5-turbo-0301': case 'gpt-3.5-turbo-0613': @@ -242,6 +238,7 @@ function tokenLimitForChatModel( case 'gpt-3.5-turbo-16k': case 'gpt-3.5-turbo-16k-0613': case 'gpt-3.5-turbo-1106': + case 'gpt-3.5-turbo-0125': return 16384 - functionEstimate - TOKENS_CONSUMED_BY_REPLY_PREFIX; default: { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/docs/docs/changelog.md b/packages/docs/docs/changelog.md index 6ed2a570..c7da786e 100644 --- a/packages/docs/docs/changelog.md +++ b/packages/docs/docs/changelog.md @@ -1,6 +1,10 @@ # Changelog -## 0.30.0 +## 0.30.1 + +- Add new OpenAI models + +## [0.30.0](https://github.com/fixie-ai/ai-jsx/tree/feecd641159e0ede554d6890a550dd172d8e24db) - Added support for Claude 3 and messages API in `AnthropicChatModel` - Relaxed function calling check for `OpenAIChatModel` diff --git a/packages/fixie-sdk/src/request-wrapper.tsx b/packages/fixie-sdk/src/request-wrapper.tsx index bb06d3a0..0020d605 100644 --- a/packages/fixie-sdk/src/request-wrapper.tsx +++ b/packages/fixie-sdk/src/request-wrapper.tsx @@ -125,7 +125,7 @@ export function FixieRequestWrapper({ }) } chatModel="gpt-3.5-turbo" - completionModel="text-davinci-003" + completionModel="gpt-3.5-turbo-instruct" > {wrappedNode}