Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

946 B
Raw Blame
import { propsValidation } from '@activepieces/pieces-common';
import { createAction } from '@activepieces/pieces-framework';
import { vlmRunAuth, vlmRunCommon } from '../common';
import { getFileProperties } from '../common/properties';
import { getFileSchema } from '../common/schemas';

export const getFile = createAction({
  auth: vlmRunAuth,
  name: 'getFile',
  displayName: 'Get File',
  description: "Gets file's metadata by ID.",
  audience: 'both',
  aiMetadata: { description: 'Retrieve the metadata for a previously uploaded VLM Run file by its file ID. Choose this to look up details of a file already stored in the account. Read-only lookup, so it is idempotent.', idempotent: true },
  props: getFileProperties,
  async run({ auth: apiKey, propsValue }) {
    await propsValidation.validateZod(propsValue, getFileSchema);
    return await vlmRunCommon.getFile({ apiKey: apiKey.secret_text, file_id: propsValue.fileId });
  },
});