Skip to content

Commit

Permalink
Merge pull request #73 from boldare/chore/update
Browse files Browse the repository at this point in the history
chore: library update
  • Loading branch information
sebastianmusial authored Aug 7, 2024
2 parents ccd686b + 9acc140 commit 226f5b2
Show file tree
Hide file tree
Showing 9 changed files with 4,113 additions and 3,390 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/app/chat/chat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const assistantParams: AssistantCreateParams = {
name: '@boldare/openai-assistant',
instructions: `You are a chatbot assistant. Use the general knowledge to answer questions. Speak briefly and clearly.`,
tools: [{ type: 'code_interpreter' }, { type: 'file_search' }],
model: 'gpt-4o',
model: 'gpt-4o-mini',
temperature: 0.05,
};

Expand All @@ -16,7 +16,7 @@ export const assistantConfig: AssistantConfigParams = {
filesDir: './apps/api/src/app/knowledge',
toolResources: {
fileSearch: {
boldare: ['33-things-to-ask-your-digital-product-development-partner.md'],
fileNames: ['33-things-to-ask-your-digital-product-development-partner.md'],
},
codeInterpreter: {
fileNames: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EventEmitter,
Input,
} from '@angular/core';
import { MessageContent } from 'openai/src/resources/beta/threads/messages';
import { MessageContent } from 'openai/resources/beta/threads/messages';

@Directive({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TextContentBlock } from 'openai/resources/beta/threads/messages';
import { ImageFileContentBlock } from 'openai/src/resources/beta/threads/messages';
import { ImageFileContentBlock } from 'openai/resources/beta/threads/messages';

export function isTextContentBlock(item?: {
type?: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/spa/src/app/modules/+chat/shared/chat.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
MessageContent,
MessageCreateParams,
} from 'openai/resources/beta/threads';
import { TextContentBlock } from 'openai/src/resources/beta/threads/messages';
import { TextContentBlock } from 'openai/resources/beta/threads/messages';
import { ChatMessage, ChatRole } from './chat.model';
import { CodeInterpreterTool, FileSearchTool } from 'openai/resources/beta';

Expand Down
2 changes: 1 addition & 1 deletion libs/openai-assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"socket.io": "^4.7.3"
},
"peerDependencies": {
"openai": "^4.51.0"
"openai": "^4.55.0"
},
"type": "commonjs",
"main": "./src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AiService } from '../ai';
import { ConfigService } from '../config';
import { AssistantCreateParams, VectorStore } from 'openai/resources/beta';
import ToolResources = AssistantCreateParams.ToolResources;
import { AssistantUpdateParams } from 'openai/src/resources/beta/assistants';
import { AssistantUpdateParams } from 'openai/resources/beta/assistants';
import {
AssistantCodeInterpreter,
AssistantFileSearch,
Expand Down
5 changes: 2 additions & 3 deletions libs/openai-assistant/src/lib/stream/stream.utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { AbstractAssistantStreamRunner } from 'openai/lib/AbstractAssistantStreamRunner';
import { AssistantStreamEvents } from 'openai/lib/AssistantStream';
import {
ImageFile,
Message,
Expand All @@ -14,9 +12,10 @@ import {
} from 'openai/resources/beta/threads/runs';
import { RunStep } from 'openai/resources/beta/threads/runs/steps';
import { ChatCallCallbacks, ChatEvents } from '../chat/chat.model';
import { AssistantStream } from 'openai/lib/AssistantStream';

export const assistantStreamEventHandler = <T>(
runner: AbstractAssistantStreamRunner<AssistantStreamEvents>,
runner: AssistantStream,
callbacks?: ChatCallCallbacks,
) => {
return runner
Expand Down
Loading

0 comments on commit 226f5b2

Please sign in to comment.