import { CodeTabs } from '../views/docs/CodeTabs';
import { Callout, NextLink, PropTable } from '../views/docs/prose';
export const SET_PERSONA_SIG_PY = `call.set_persona(
    organization_name: str | None = None,
    agent_name: str | None = None,
    agent_purpose: str | None = None,
    voice: str | None = None,
)`;

export const SET_PERSONA_SIG_TS = `await call.setPersona({
  organizationName?: string,
  agentName?: string,
  agentPurpose?: string,
  voice?: string,
})`;

export const SET_PERSONA_EX_PY = `call.set_persona(
    organization_name="Bright Smile Dental",
    agent_name="Alex",
    agent_purpose="You are calling patients to help them schedule and confirm dental appointments",
    voice="grace",
)`;

export const SET_PERSONA_EX_TS = `await call.setPersona({
  organizationName: "Bright Smile Dental",
  agentName: "Alex",
  agentPurpose: "Help patients schedule dental appointments",
})`;

## set\_persona()

`call.set_persona()` is deliberately minimal. Give it the organization name and let the agent figure out the tone. You don't need to specify a voice style, a greeting template, or a list of prohibited phrases — Guava's defaults are professional and natural.

<CodeTabs
  python={{ code: SET_PERSONA_SIG_PY, filename: "signature" }}
  typescript={{ code: SET_PERSONA_SIG_TS, filename: "signature" }}
/>

<PropTable rows={[
  {
    name: "organization_name",
    type: "str | None",
    desc: "The organization the agent represents. Used in introductions.",
  },
  {
    name: "agent_name",
    type: "str | None",
    desc: "The agent's first name. Defaults to a generic 'assistant' style.",
  },
  {
    name: "agent_purpose",
    type: "str | None",
    desc: "A sentence describing why the agent is calling. Sets the LLM's operating context.",
  },
  {
    name: "voice",
    type: "str | None",
    default: '"grace"',
    desc: 'The TTS voice to use. Options: "grace" (southern female) or "jack" (British male). For languages outside of English, only the "grace" voice is supported.',
  },
]} />

### Example

<CodeTabs
  python={{ code: SET_PERSONA_EX_PY, filename: "example.py" }}
  typescript={{ code: SET_PERSONA_EX_TS, filename: "example.ts" }}
/>

<Callout>
  <span className="text-primary font-semibold">Tip:</span> Include the contact's name in `agent_purpose` to help the agent personalize the conversation naturally.
</Callout>

<NextLink section="field" label="Field" />
