Skip to content

The open alternative to Salesforce, designed for AI.

538 B
Raw Blame
import gql from 'graphql-tag';

export const runAgentInConversationQueryFactory = ({
  agentUniversalIdentifier,
  content,
  threadKey,
}: {
  agentUniversalIdentifier: string;
  content: string;
  threadKey: string;
}) => ({
  query: gql`
    mutation RunAgent($input: RunAgentInput!) {
      runAgent(input: $input) {
        threadId
        runId
        status
      }
    }
  `,
  variables: {
    input: {
      agentUniversalIdentifier,
      input: [{ role: 'user', content }],
      thread: { key: threadKey },
    },
  },
});