Skip to content

Commit

Permalink
feat: ai interface added
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadeera3784 committed Jun 15, 2024
1 parent 23c9b6a commit 2308918
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
32 changes: 0 additions & 32 deletions apps/backend/src/modules/ai/interfaces/ai.constants.ts

This file was deleted.

38 changes: 38 additions & 0 deletions apps/backend/src/modules/ai/interfaces/ai.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export interface AssociativeObject {
[key: string]: unknown;
}

export interface GPTResult {
data: AssociativeObject;
notes: string;
content: string;
}

export interface Context extends AssociativeObject {
history: ContextHistory[];
passed: boolean;
}

export interface ContextHistory {
type: string;
output: AssociativeObject | BooleanOutcome | DataOutcome;
}

export interface Outcome {
metadata: OutcomeMetadata | null;
}

export interface BooleanOutcome extends Outcome {
outcome: boolean;
}

export interface DataOutcome extends Outcome {
data: unknown;
}

export interface OutcomeMetadata extends AssociativeObject {
data?: AssociativeObject & {
assessments?: AssociativeObject[];
};
comment?: string;
}
1 change: 1 addition & 0 deletions apps/backend/src/modules/ai/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ai.interface';
2 changes: 1 addition & 1 deletion apps/backend/src/modules/ai/services/ai.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ChatCompletionCreateParamsNonStreaming, ChatCompletionMessageParam } from 'openai/resources';

import { AssociativeObject , GPTResult, Outcome} from '../interfaces/ai.constants';
import { AssociativeObject , GPTResult, Outcome} from '../interfaces';
import { OpenAIService } from './open-ai-service';
import configuration from '../../../config/configuration';

Expand Down

0 comments on commit 2308918

Please sign in to comment.