Skip to content

The open alternative to Salesforce, designed for AI.

746 B
Raw Blame
import { Field, InputType } from '@nestjs/graphql';

import {
  IsNotEmpty,
  IsObject,
  IsOptional,
  IsString,
  IsUUID,
} from 'class-validator';
import GraphQLJSON from 'graphql-type-json';

import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';

@InputType()
export class AnswerToolCallInput {
  @Field(() => UUIDScalarType)
  @IsUUID()
  threadId: string;

  @Field(() => String)
  @IsString()
  @IsNotEmpty()
  toolCallId: string;

  @Field(() => GraphQLJSON, {
    description: 'The answer, validated against what the tool call asked',
  })
  @IsObject()
  response: Record<string, unknown>;

  @Field(() => String, { nullable: true })
  @IsOptional()
  @IsString()
  modelId?: string;
}