import { CodeTabs } from '../views/docs/CodeTabs';
import { NextLink, PropTable } from '../views/docs/prose';

export const ADD_INFO_SIG_PY = `def add_info(label: str, info: Any) -> None`;

export const ADD_INFO_SIG_TS = `addInfo(label: string, info: any): Promise<void>`;

export const ADD_INFO_EX_PY = `AMENITIES_INFO = {
    "amenities": [
        "Rooftop pool",
        "Full-service spa",
        "Fitness center",
        "Business center",
        "Complimentary airport shuttle",
    ]
}

agent = guava.Agent(
    name="Riley",
    organization="Oceanfront Hotel",
    purpose="You are the head concierge tasked with assisting guests with questions and reservations.",
)

@agent.on_call_start
def on_call_start(call: guava.Call):
    call.add_info("amenities_details", AMENITIES_INFO)`;

export const ADD_INFO_EX_TS = `const AMENITIES_INFO = {
  amenities: [
    "Rooftop pool",
    "Full-service spa",
    "Fitness center",
    "Business center",
    "Complimentary airport shuttle",
  ],
};

const agent = new guava.Agent({
  name: "Riley",
  organization: "Oceanfront Hotel",
  purpose: "You are the head concierge tasked with assisting guests with questions and reservations.",
});

agent.onCallStart(async (call: guava.Call) => {
  await call.addInfo("amenities_details", AMENITIES_INFO);
})`;

## add\_info()

`add_info()` can be used to provide Guava agents with additional context. Once called, the information persists for the duration of the call and
surfaces naturally when relevant. It can be called at the start of a call as well as any time during a call.

<CodeTabs
  python={{ code: ADD_INFO_SIG_PY, filename: "signature" }}
  typescript={{ code: ADD_INFO_SIG_TS, filename: "signature" }}
/>

### Example

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

<NextLink section="get-field" label="get_field()" />
