diff --git a/lib/chats/index.ts b/lib/chats/index.ts index adbec8c..3da4fcb 100644 --- a/lib/chats/index.ts +++ b/lib/chats/index.ts @@ -1,6 +1,5 @@ import axios, { AxiosError } from "axios"; import * as t from "polyfact-io-ts"; -import { UUID } from "crypto"; import { generate, @@ -24,7 +23,7 @@ const Message = t.type({ export async function createChat( systemPrompt?: string, - systemPromptId?: UUID, + systemPromptId?: string, options: InputClientOptions = {}, ): Promise { try { @@ -180,13 +179,13 @@ export class Chat { } export type ChatClient = { - createChat: (systemPrompt?: string, systemPromptId?: UUID) => Promise; + createChat: (systemPrompt?: string, systemPromptId?: string) => Promise; Chat: typeof Chat; }; export default function client(clientOptions: InputClientOptions = {}): ChatClient { return { - createChat: (systemPrompt?: string, systemPromptId?: UUID) => + createChat: (systemPrompt?: string, systemPromptId?: string) => createChat(systemPrompt, systemPromptId, clientOptions), Chat: class C extends Chat { constructor(options: ChatOptions = {}) { diff --git a/lib/generate.ts b/lib/generate.ts index 0aab8f5..b192d14 100644 --- a/lib/generate.ts +++ b/lib/generate.ts @@ -2,7 +2,6 @@ import * as t from "polyfact-io-ts"; import fakeProcess from "process"; import { Readable } from "readable-stream"; import WebSocket from "isomorphic-ws"; -import { UUID } from "crypto"; import { InputClientOptions, defaultOptions } from "./clientOpts"; import { Memory } from "./memory"; import { loaderToMemory, LoaderFunction } from "./dataloader"; @@ -76,7 +75,7 @@ export type MemoryOptions = [ { data: [LoaderFunction] | LoaderFunction }, ]; -export type SystemPromptOptions = [{ systemPromptId: UUID }, { systemPrompt: string }]; +export type SystemPromptOptions = [{ systemPromptId: string }, { systemPrompt: string }]; export type GenerationWithWebOptions = GenerationSimpleOptions & NeverN & diff --git a/package.json b/package.json index 5586b55..e06510a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyfire-js", - "version": "0.2.10", + "version": "0.2.11", "main": "index.js", "types": "index.d.ts", "author": "Lancelot Owczarczak ",