Skip to content

Commit

Permalink
Merge pull request #98 from pufflyai/96-add-gpt-4-turbo-2
Browse files Browse the repository at this point in the history
96 add gpt 4 turbo 2
  • Loading branch information
au-re authored Nov 23, 2023
2 parents 2562bde + 86c6c52 commit 1f0c48b
Show file tree
Hide file tree
Showing 15 changed files with 224 additions and 1,567 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.23.0"
"version": "0.23.2"
}
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/@pufflig/ps-chains/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pufflig/ps-chains",
"version": "0.23.0",
"version": "0.23.1",
"license": "MIT",
"main": "./dist/ps-chains.umd.js",
"module": "./dist/ps-chains.es.js",
Expand All @@ -16,7 +16,7 @@
"test": "jest"
},
"devDependencies": {
"@pufflig/ps-types": "^0.23.0",
"@pufflig/ps-types": "^0.23.1",
"@types/react-dom": "^18.2.7",
"immer": "^10.0.2",
"prop-types": "^15.8.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/@pufflig/ps-models/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pufflig/ps-models",
"private": false,
"version": "0.23.0",
"version": "0.23.2",
"description": "Configuration of models used in Prompt Studio",
"files": [
"dist"
Expand All @@ -16,7 +16,7 @@
"author": "Pufflig AB",
"license": "MIT",
"devDependencies": {
"@pufflig/ps-types": "^0.23.0",
"@pufflig/ps-types": "^0.23.1",
"typescript": "^5.2.2",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0"
Expand Down
28 changes: 26 additions & 2 deletions packages/@pufflig/ps-models/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ModelConfig } from "@pufflig/ps-types";
import { hf_completion, hf_settings } from "./models/hf";
import { open_router_completion, open_router_settings } from "./models/open_router";
import { openai_chat, openai_completion, openai_embedding, openai_settings } from "./models/openai";

export const chat_models = { ...openai_chat };
export const completion_models = { ...openai_completion, ...open_router_completion, ...hf_completion };
export const embedding_models = { ...openai_embedding };
export const models = { ...openai_chat, ...openai_completion, ...open_router_completion, ...hf_completion };

// provider settings
export const settings = [...openai_settings, ...hf_settings, ...open_router_settings];
Expand All @@ -32,11 +32,35 @@ export { OPENAI_API_KEY } from "./models/openai";
export { HF_ACCESS_TOKEN } from "./models/hf";
export { OPEN_ROUTER_API_KEY } from "./models/open_router";

// openai specific models
// provider specific models
export const openai = {
chat_models: openai_chat,
completion_models: openai_completion,
embedding_models: openai_embedding,
};

export const hf = {
completion_models: hf_completion,
};

export const open_router = {
completion_models: open_router_completion,
};

// defaults
export const default_completion_model = "gpt-3.5-turbo-instruct";
export const default_assistant_model = "gpt-4-1106-preview";

export const available_models = [
"gpt-3.5-turbo-instruct",
"gpt-4-1106-preview",
"anthropic/claude-2",
"meta-llama/llama-2-13b-chat",
];

export const models = Object.entries({ ...completion_models, ...chat_models })
.filter(([modelId]) => available_models.includes(modelId))
.reduce((acc, [modelId, model]) => {
acc[modelId] = model;
return acc;
}, {} as Record<string, ModelConfig>);
6 changes: 3 additions & 3 deletions packages/@pufflig/ps-nodes-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pufflig/ps-nodes-config",
"private": false,
"version": "0.23.0",
"version": "0.23.2",
"description": "Configuration files for nodes used in prompt studio.",
"files": [
"dist"
Expand All @@ -16,10 +16,10 @@
"author": "Pufflig AB",
"license": "MIT",
"dependencies": {
"@pufflig/ps-models": "^0.23.0"
"@pufflig/ps-models": "^0.23.2"
},
"devDependencies": {
"@pufflig/ps-types": "^0.23.0",
"@pufflig/ps-types": "^0.23.1",
"@types/jest": "^29.5.8",
"jest": "^29.7.0",
"ts-jest": "^29.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_completion_model, models } from "@pufflig/ps-models";
import { NodeConfig } from "@pufflig/ps-types";
import { default_model, models } from "../../constants";

export const documentCheckNodeType = "modifier/document_check" as const;

Expand Down Expand Up @@ -38,7 +38,7 @@ export const documentCheck: NodeConfig = {
type: "model",
definition: models,
defaultValue: {
modelId: default_model,
modelId: default_completion_model,
parameters: {},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { models } from "@pufflig/ps-models";
import { default_completion_model, models } from "@pufflig/ps-models";
import { NodeConfig } from "@pufflig/ps-types";
import { default_model } from "../../constants";

export const llmCompletionNodeType = "adapter/llm_completion" as const;

Expand Down Expand Up @@ -40,7 +39,7 @@ export const llmCompletionConfig: NodeConfig = {
type: "model",
definition: models,
defaultValue: {
modelId: default_model,
modelId: default_completion_model,
parameters: {},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { openai, OPENAI_API_KEY } from "@pufflig/ps-models";
import { default_completion_model, openai, OPENAI_API_KEY } from "@pufflig/ps-models";
import { NodeConfig } from "@pufflig/ps-types";
import { default_model } from "../../constants";

export const openaiCompletionConfig: NodeConfig = {
name: "OpenAI (Completion)",
Expand Down Expand Up @@ -45,7 +44,7 @@ export const openaiCompletionConfig: NodeConfig = {
type: "model",
definition: openai.completion_models,
defaultValue: {
modelId: default_model,
modelId: default_completion_model,
parameters: {},
},
},
Expand Down
17 changes: 0 additions & 17 deletions packages/@pufflig/ps-nodes-config/src/constants.ts

This file was deleted.

7 changes: 3 additions & 4 deletions packages/@pufflig/ps-nodes-config/src/data/model/model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { default_completion_model, models } from "@pufflig/ps-models";
import { NodeConfig } from "@pufflig/ps-types";
import { default_model } from "../../constants";
import { models } from "@pufflig/ps-models";

export const modelNodeType = "data/model" as const;

Expand All @@ -17,7 +16,7 @@ export const model: NodeConfig = {
type: "model",
definition: { ...models },
defaultValue: {
modelId: default_model,
modelId: default_completion_model,
parameters: {},
},
},
Expand All @@ -28,7 +27,7 @@ export const model: NodeConfig = {
name: "Model Name",
description: "The name of the model to use.",
type: "selection",
defaultValue: default_model,
defaultValue: default_completion_model,
options: Object.keys({ ...models }).map((modelId) => ({
id: modelId,
name: modelId,
Expand Down
10 changes: 5 additions & 5 deletions packages/@pufflig/ps-nodes/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pufflig/ps-nodes",
"private": false,
"version": "0.23.0",
"version": "0.23.2",
"description": "Collection of nodes used in Prompt Studio",
"files": [
"dist"
Expand All @@ -17,7 +17,7 @@
"author": "Pufflig AB",
"license": "MIT",
"devDependencies": {
"@pufflig/ps-types": "^0.23.0",
"@pufflig/ps-types": "^0.23.1",
"@types/jest": "^29.5.8",
"@types/lodash": "^4.14.196",
"@types/mustache": "^4.2.2",
Expand All @@ -33,9 +33,9 @@
},
"dependencies": {
"@dqbd/tiktoken": "^1.0.7",
"@pufflig/ps-models": "^0.23.0",
"@pufflig/ps-nodes-config": "^0.23.0",
"@pufflig/ps-sdk": "^0.23.0",
"@pufflig/ps-models": "^0.23.2",
"@pufflig/ps-nodes-config": "^0.23.2",
"@pufflig/ps-sdk": "^0.23.2",
"axios": "^1.6.2",
"langchain": "^0.0.193",
"lodash": "^4.17.21",
Expand Down
Loading

0 comments on commit 1f0c48b

Please sign in to comment.