Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/arg-tech/xaif/llms.txt

Use this file to discover all available pages before exploring further.

add_component is the primary mutation method on the AIF class. It dispatches to a private implementation method based on the component_type argument, keeping the public API surface minimal while supporting four distinct graph-building operations. All changes are applied directly to the in-memory aif dict and are immediately reflected in aif.nodes, aif.locutions, and aif.participants.

Signature

aif.add_component(component_type: str, **kwargs)
component_type
str
required
Selects which kind of component to add. Must be one of:
  • "locution" — add a new L-node and locution entry
  • "proposition" — add an I-node and YA-node linked to an existing L-node
  • "argument_relation" — add an RA, CA, or MA relation node between two I-nodes
  • "segment" — split an existing L-node into multiple new L-nodes

component_type="locution"

Adds a new L-node to AIF["nodes"], a corresponding entry to AIF["locutions"], and — if the named speaker is not already present — appends the speaker to AIF["participants"].

kwargs

text
str
required
The spoken text to store on the L-node.
speaker
str
required
Full name of the speaker in "Firstname Lastname" format. The string is split on whitespace to produce firstname and surname fields in the participants list.

Example

aif.add_component(
    component_type="locution",
    text="The economy is struggling.",
    speaker="Jane Doe"
)

component_type="proposition"

Links an existing L-node to a new propositional content (I-node) via a YA-node labelled "Default Illocuting". Creates two new nodes and two directed edges: L → YA and YA → I.

kwargs

Lnode_ID
int
required
The nodeID of the L-node that the proposition is derived from. Must already exist in AIF["nodes"].
proposition
str
required
The propositional content to store on the new I-node.

Example

aif.add_component(
    component_type="proposition",
    Lnode_ID=0,
    proposition="The economy is in recession."
)

component_type="argument_relation"

Adds a relation node (RA, CA, or MA) between two existing I-nodes and creates two directed edges: iNode_ID1 → relation_node and relation_node → iNode_ID2. The default node text is derived from relation_type unless overridden by AR_text.
relation_typeNode typeDefault text
RARA"Default Inference"
CACA"Default Conflict"
MAMA"Default Rephrase"

kwargs

relation_type
str
required
One of "RA" (inference / support), "CA" (conflict / attack), or "MA" (rephrase / equivalence).
iNode_ID1
int
required
The nodeID of the source I-node (the premise or attacking proposition).
iNode_ID2
int
required
The nodeID of the target I-node (the conclusion or proposition being attacked).
AR_text
str
Accepted by the signature but not used — the relation node text is always set from relation_type via the internal if/elif chain ("Default Inference" for RA, "Default Conflict" for CA, "Default Rephrase" for MA). Any value passed here will be silently overwritten.

Example

# Inference: node 2 supports node 4
aif.add_component(
    component_type="argument_relation",
    relation_type="RA",
    iNode_ID1=2,
    iNode_ID2=4
)

# Conflict: node 6 attacks node 4
aif.add_component(
    component_type="argument_relation",
    relation_type="CA",
    iNode_ID1=6,
    iNode_ID2=4
)

component_type="segment"

Splits an existing L-node into multiple new L-nodes — one per string in segments — all attributed to the same speaker as the original L-node. After adding the new nodes, it calls remove_entry to delete the original L-node together with its associated I-node, YA-node, edges, and locution entry.

kwargs

Lnode_ID
int
required
The nodeID of the L-node to split. This node is removed once the new segment nodes are created.
segments
list[str]
required
A list of text strings, one per new L-node to create. Each string becomes the text field of a new L-node, and a corresponding locution entry is added with the same personID as the original.

Example

# Split locution 2 into two separate locutions
aif.add_component(
    component_type="segment",
    Lnode_ID=2,
    segments=["The third text.", "Fourth text."]
)

Passing a component_type value other than "locution", "proposition", "argument_relation", or "segment" raises a ValueError. There is no partial-application or fallback behaviour.

Build docs developers (and LLMs) love