Skip to content

Commit

Permalink
update: release v1.7.11
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Dec 11, 2023
1 parent d987cf5 commit 5fa8ae1
Show file tree
Hide file tree
Showing 29 changed files with 69 additions and 53 deletions.
42 changes: 29 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,13 @@ This output will be used as typescript .ts file, so you must not include any oth
import { Timestamp, FieldValue } from '@skeet-framework/firestore'
import { <ExistingModel>CN } from '@common/models/<ExistingModelLowerCase>Models'

// CollectionId: <modelName>
// DocumentId: auto
// Path: <ExistingModel>/\${<ExistingModel>Id}/<modelName>
/**
* Type definition for documents in the 'Hey' collection.
*
* @collectionId <modelName>
* @documentId auto-generated
* @path <ExistingModel>/\${<ExistingModel>Id}/<modelName>
*/
export const <modelName>CN = '<modelName>'
export const gen<modelName>Path = (userId: string) => \`\${<ExistingModel>CN}/\${<ExistingModelLowerCase>Id}/\${<modelName>CN}\`
export type <modelName> = {
Expand All @@ -652,9 +656,13 @@ export type <modelName> = {
`,examples:[{input:"I want to create a blog app.",output:`import { Timestamp, FieldValue } from '@skeet-framework/firestore'
import { UserCN } from '@common/models/userModels'

// CollectionId: Post
// DocumentId: auto
// Path: User/\${UserId}/Post
/**
* Type definition for documents in the 'Hey' collection.
*
* @collectionId Post
* @documentId auto-generated
* @path User/\${userId}/Post
*/
export const PostCN = 'Post'
export const genPostPath = (userId: string) => \`\${UserCN}/\${userId}/\${PostCN}\`
export type Post = {
Expand All @@ -668,9 +676,13 @@ export type Post = {
`},{input:"I want to add a comment feature to the blog functionality.",output:`import { Timestamp, FieldValue } from '@skeet-framework/firestore
import { UserCN } from '@common/models/userModels'

// CollectionId: Post
// DocumentId: auto
// Path: User/\${UserId}/Post
/**
* Type definition for documents in the 'Post' collection.
*
* @collectionId Post
* @documentId auto-generated
* @path User/\${userId}/Post
*/
export const PostCN = 'Post'
export const genPostPath = (userId: string) => \`\${UserCN}/\${userId}/\${PostCN}\`
export type Post = {
Expand All @@ -682,9 +694,13 @@ export type Post = {
userId: string
}

// CollectionId: Comment
// DocumentId: auto
// Path: User/\${UserId}/Post/\${PostId}/Comment
/**
* Type definition for documents in the 'Comment' collection.
*
* @collectionId Comment
* @documentId auto-generated
* @path User/\${userId}/Post/\${postId}/Comment
*/
export const CommentCN = 'Comment'
export const genCommentPath = (userId: string, postId: string) => \`\${UserCN}/\${userId}/\${PostCN}/\${postId}/\${CommentCN}\`
export type Comment = {
Expand Down Expand Up @@ -895,7 +911,7 @@ You must use <@skeet-framework/firestore> to retrieve data from Firestore.
catch (error) {
throw new Error(\`findLargest: \${error}\`)
}
}`}]}};var Hz=async(d,o,p,c,l,u,O,y)=>{try{let m=zz(p,c,l,u,O,y);return await jn(m,d,o.ai,o.aiInstance)}catch(m){throw new Error(`skeetNaming: ${m}`)}};Qz.config();var th=class d{ai;model;maxTokens;temperature;_initOptions;static PRISMA_SCHEMA_PATH="./graphql/prisma/schema.prisma";static MODEL_PATH="./functions/skeet/src/models";static FUNCTION_ROOT="./functions";aiInstance;functionConfigPaths=o=>({packageJson:`${d.FUNCTION_ROOT}/${o}/package.json`,tsconfigJson:`${d.FUNCTION_ROOT}/${o}/tsconfig.json`});constructor(o={}){this.ai=o.ai||"VertexAI",this.model=o.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=o.maxTokens||1e3,this.temperature=o.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Iu({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Fu({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=o}get initOptions(){return this._initOptions}async prisma(o){try{return await hz(o,this)}catch(p){this.handleError(p)}}async skeet(o){try{return await yz(o,this)}catch(p){throw new Error(`skeet: ${p}`)}}async uploadFile(o){try{return await cz(o,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async createFineTuningJob(o,p="gpt-3.5-turbo-0613"){try{return await sz(o,p,this.ai,this.aiInstance)}catch(c){this.handleError(c)}}async showFineTuningJob(o){try{return await dz(o,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async typedoc(o){try{return await Sz(o,this)}catch(p){this.handleError(p)}}async naming(o,p="function"){try{return await _z(o,this,p)}catch(c){this.handleError(c)}}async translates(o,p="ja",c="en"){try{return await Az(o,p,c,this)}catch(l){this.handleError(l)}}async firestore(o){try{return await Iz(o,this)}catch(p){this.handleError(p)}}async function(o,p,c,l,u,O,y){try{return await Hz(o,this,p,c,l,u,O,y)}catch(m){this.handleError(m)}}async method(o,p,c,l,u,O){try{return await Lz(o,this,p,c,l,u,O)}catch(y){this.handleError(y)}}async run(o,p){try{let c=za(o.context,o.examples,p,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(c):await this.aiInstance.prompt(c)}catch(c){throw new Error(`run: ${c}`)}}handleError(o){console.error("Error:",o)}},tp=th;0&&(module.exports={InstanceType,NamingEnum,OpenAI,SkeetAI,SkeetAiMode,Stream,VertexAI,aiplatform,generatePrompt,openai,translate});
}`}]}};var Hz=async(d,o,p,c,l,u,O,y)=>{try{let m=zz(p,c,l,u,O,y);return await jn(m,d,o.ai,o.aiInstance)}catch(m){throw new Error(`skeetNaming: ${m}`)}};Qz.config();var th=class d{ai;model;maxTokens;temperature;_initOptions;static PRISMA_SCHEMA_PATH="./graphql/prisma/schema.prisma";static MODEL_PATH="./common/models";static FUNCTION_ROOT="./functions";aiInstance;functionConfigPaths=o=>({packageJson:`${d.FUNCTION_ROOT}/${o}/package.json`,tsconfigJson:`${d.FUNCTION_ROOT}/${o}/tsconfig.json`});constructor(o={}){this.ai=o.ai||"VertexAI",this.model=o.model||(this.ai==="VertexAI"?"chat-bison@001":"gpt-4"),this.maxTokens=o.maxTokens||1e3,this.temperature=o.temperature||0,this.ai==="VertexAI"?this.aiInstance=new Iu({model:this.model,maxOutputTokens:this.maxTokens}):this.aiInstance=new Fu({model:this.model,maxTokens:this.maxTokens,apiKey:process.env.CHAT_GPT_KEY||"",organizationKey:process.env.CHAT_GPT_ORG||""}),this._initOptions=o}get initOptions(){return this._initOptions}async prisma(o){try{return await hz(o,this)}catch(p){this.handleError(p)}}async skeet(o){try{return await yz(o,this)}catch(p){throw new Error(`skeet: ${p}`)}}async uploadFile(o){try{return await cz(o,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async createFineTuningJob(o,p="gpt-3.5-turbo-0613"){try{return await sz(o,p,this.ai,this.aiInstance)}catch(c){this.handleError(c)}}async showFineTuningJob(o){try{return await dz(o,this.ai,this.aiInstance)}catch(p){this.handleError(p)}}async typedoc(o){try{return await Sz(o,this)}catch(p){this.handleError(p)}}async naming(o,p="function"){try{return await _z(o,this,p)}catch(c){this.handleError(c)}}async translates(o,p="ja",c="en"){try{return await Az(o,p,c,this)}catch(l){this.handleError(l)}}async firestore(o){try{return await Iz(o,this)}catch(p){this.handleError(p)}}async function(o,p,c,l,u,O,y){try{return await Hz(o,this,p,c,l,u,O,y)}catch(m){this.handleError(m)}}async method(o,p,c,l,u,O){try{return await Lz(o,this,p,c,l,u,O)}catch(y){this.handleError(y)}}async run(o,p){try{let c=za(o.context,o.examples,p,this.ai);return this.ai==="VertexAI"?await this.aiInstance.prompt(c):await this.aiInstance.prompt(c)}catch(c){throw new Error(`run: ${c}`)}}handleError(o){console.error("Error:",o)}},tp=th;0&&(module.exports={InstanceType,NamingEnum,OpenAI,SkeetAI,SkeetAiMode,Stream,VertexAI,aiplatform,generatePrompt,openai,translate});
/*! Bundled license information:

@grpc/proto-loader/build/src/util.js:
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const VERSION = "1.7.10";
export declare const VERSION = "1.7.11";
4 changes: 2 additions & 2 deletions docs/classes/OpenAI-1.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/SkeetAI.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/VertexAI.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/InstanceType.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/NamingEnum.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/SkeetAiMode.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/generatePrompt.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/translate.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/interfaces/AIPrompt.html

Large diffs are not rendered by default.

Loading

0 comments on commit 5fa8ae1

Please sign in to comment.