Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: library update #73

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Czy chcemy zmieniać model domyślnie?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in this case, we can reduce costs and this model is enough for our test cases for our demo

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