diff --git a/nexus-next/TAP/agent-development.md b/nexus-next/TAP/agent-development.md index f990a51..98f997f 100644 --- a/nexus-next/TAP/agent-development.md +++ b/nexus-next/TAP/agent-development.md @@ -33,4 +33,5 @@ The choice of how to build the agent will be determined by weighing: Continue learning about agent development with the following sections: * the [Nexus interface for TAPs](../packages/nexus-interface.md) section, outlining what interface the TAP must comply with -* the reference [default TAP](default-tap.md) implementation, that serves as an example for a bare-bones TAP \ No newline at end of file +* the reference [default TAP](default-tap.md) implementation, that serves as an example for a bare-bones TAP + diff --git a/nexus-next/TAP/default-tap.md b/nexus-next/TAP/default-tap.md index fab6c3d..c56f154 100644 --- a/nexus-next/TAP/default-tap.md +++ b/nexus-next/TAP/default-tap.md @@ -349,3 +349,4 @@ fun get_witness(self: &DefaultSAP): &DefaultSAPV1Witness { ``` + diff --git a/nexus-next/conventions/sui-move.md b/nexus-next/conventions/sui-move.md index 6717102..bd384cd 100644 --- a/nexus-next/conventions/sui-move.md +++ b/nexus-next/conventions/sui-move.md @@ -6,3 +6,4 @@ In Nexus and related packages we (to the best of our ability) follow these conve Each enumeration variant contains a property `_variant_name: AsciiString`, which will always be a static string representing the variant name. This helps clients to identify the variant because at the moment RPCs do not include the variant name in the response. + diff --git a/nexus-next/crates/leader.md b/nexus-next/crates/leader.md index 28ec200..6def119 100644 --- a/nexus-next/crates/leader.md +++ b/nexus-next/crates/leader.md @@ -165,4 +165,5 @@ stateDiagram-v2 if_stale --> [*]: NotStale MoveBackToQueuedSet --> [*] } -``` \ No newline at end of file +``` + diff --git a/nexus-next/crates/sui-tx.md b/nexus-next/crates/sui-tx.md index 523d14e..824f1c2 100644 --- a/nexus-next/crates/sui-tx.md +++ b/nexus-next/crates/sui-tx.md @@ -7,3 +7,4 @@ The Leader will be assigned a wallet via the `SUI_SECRET_MNEMONIC` environment v Initially, there will only be one transaction type from Leader back to Workflow. This transaction notifies the Workflow of the Tool invocation result. More details are available in the [Leader](leader.md) documentation. Once onchain Tools are defined, the Leader will also have to send transactions to invoke these Tools. These are currently still in the design phase however. + diff --git a/nexus-next/gas-service.md b/nexus-next/gas-service.md index 410edce..8013b2b 100644 --- a/nexus-next/gas-service.md +++ b/nexus-next/gas-service.md @@ -335,3 +335,4 @@ public fun donate_to_tool( ``` + diff --git a/nexus-next/glossary.md b/nexus-next/glossary.md index f8917ef..e25fd21 100644 --- a/nexus-next/glossary.md +++ b/nexus-next/glossary.md @@ -26,3 +26,4 @@ - **`Output Variant`** - A mutually exclusive variant of the tool's output. - **`Output Port`** - A single output (field) of a Tool within an Output Variant. - **`Entry Group`** - A named set of vertices that define an entry configuration for DAG execution. + diff --git a/nexus-next/index.md b/nexus-next/index.md index f613915..176f63b 100644 --- a/nexus-next/index.md +++ b/nexus-next/index.md @@ -73,3 +73,4 @@ Nexus offers [tool and agent developers](index.md#actors) an easy-to-use SDK con Docs: * [Nexus SDK documentation](../nexus-sdk/index.md) + diff --git a/nexus-next/packages/nexus-interface.md b/nexus-next/packages/nexus-interface.md index a6ed362..b732ede 100644 --- a/nexus-next/packages/nexus-interface.md +++ b/nexus-next/packages/nexus-interface.md @@ -51,3 +51,4 @@ Unfortunately, Sui does not give us a way to get current package ID. When upgrading a package you must create a new type that serves as a witness. This new type needs to be used when emitting `AnnounceInterfacePackageEvent` as its generic. This event _also_ needs to be emitted with every package upgrade. + diff --git a/nexus-next/packages/primitives.md b/nexus-next/packages/primitives.md index 12e9395..2d005a8 100644 --- a/nexus-next/packages/primitives.md +++ b/nexus-next/packages/primitives.md @@ -18,11 +18,11 @@ Therefore, upgrading components is less likely to require changes to other compo `UID` (Unique Identifier) proves that an object exist on-chain and its unique. By requiring passing a UID reference as the input and keeping a record of the ID of the UID that was passed as argument we can prove that only the module that defined that object did that operation. As only that module can access the UID. -This is achieved with the [hot potato pattern][move-hot-potato]. +This is achieved with the [hot potato pattern](https://move-book.com/programmability/hot-potato-pattern.html). {% hint style="info" %} This is a step away from explicitness and towards conventions. -Prior similar work includes [Originbyte's `request` module][ob-request-module] and [Mysten's `transfer_policy` module][sui-transfer-policy]. +Prior similar work includes [Originbyte's `request` module](https://github.com/Origin-Byte/nft-protocol/tree/main/contracts/request/sources/request) and [Mysten's `transfer_policy` module](https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/packages/sui-framework/sources/kiosk/transfer_policy.move). {% endhint %} A hot potato struct that enables authenticated communication between different packages without explicit dependencies. The `ProofOfUID` is created by one package and subsequently utilized across (potentially) multiple calls inside a PTB, allowing different participating packages to add their unique stamps. @@ -185,8 +185,3 @@ These primitives are designed to work synergistically, enabling the construction - Optional recipient restriction adds targeted security - Clear verification of data provenance - - -[move-hot-potato]: https://move-book.com/programmability/hot-potato-pattern.html -[ob-request-module]: https://github.com/Origin-Byte/nft-protocol/tree/main/contracts/request/sources/request -[sui-transfer-policy]: https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/packages/sui-framework/sources/kiosk/transfer_policy.move \ No newline at end of file diff --git a/nexus-next/packages/reference/nexus_interface/v1.md b/nexus-next/packages/reference/nexus_interface/v1.md index 3d3c206..682c4a6 100644 --- a/nexus-next/packages/reference/nexus_interface/v1.md +++ b/nexus-next/packages/reference/nexus_interface/v1.md @@ -85,3 +85,4 @@ package upgrade. + diff --git a/nexus-next/packages/reference/nexus_interface/version.md b/nexus-next/packages/reference/nexus_interface/version.md index ecaab5b..9eee110 100644 --- a/nexus-next/packages/reference/nexus_interface/version.md +++ b/nexus-next/packages/reference/nexus_interface/version.md @@ -128,3 +128,4 @@ + diff --git a/nexus-next/packages/reference/nexus_primitives/data.md b/nexus-next/packages/reference/nexus_primitives/data.md index 25f72a4..646e83f 100644 --- a/nexus-next/packages/reference/nexus_primitives/data.md +++ b/nexus-next/packages/reference/nexus_primitives/data.md @@ -167,3 +167,4 @@ Serialization conventions are agreed on by the off-chain realm. + diff --git a/nexus-next/packages/reference/nexus_primitives/event.md b/nexus-next/packages/reference/nexus_primitives/event.md index 7f3ae2d..d1f28f2 100644 --- a/nexus-next/packages/reference/nexus_primitives/event.md +++ b/nexus-next/packages/reference/nexus_primitives/event.md @@ -63,3 +63,4 @@ + diff --git a/nexus-next/packages/reference/nexus_primitives/owner_cap.md b/nexus-next/packages/reference/nexus_primitives/owner_cap.md index e0274bf..1f836cd 100644 --- a/nexus-next/packages/reference/nexus_primitives/owner_cap.md +++ b/nexus-next/packages/reference/nexus_primitives/owner_cap.md @@ -476,3 +476,4 @@ Inner [OwnerCap] will be dropped. + diff --git a/nexus-next/packages/reference/nexus_primitives/proof_of_uid.md b/nexus-next/packages/reference/nexus_primitives/proof_of_uid.md index 98f2532..c23e672 100644 --- a/nexus-next/packages/reference/nexus_primitives/proof_of_uid.md +++ b/nexus-next/packages/reference/nexus_primitives/proof_of_uid.md @@ -345,3 +345,4 @@ Add a stamp to the proof. + diff --git a/nexus-next/packages/reference/nexus_primitives/proven_value.md b/nexus-next/packages/reference/nexus_primitives/proven_value.md index b754bc6..56e2bcc 100644 --- a/nexus-next/packages/reference/nexus_primitives/proven_value.md +++ b/nexus-next/packages/reference/nexus_primitives/proven_value.md @@ -257,3 +257,4 @@ Who is the recipient of the value, if any. + diff --git a/nexus-next/packages/reference/nexus_workflow/dag.md b/nexus-next/packages/reference/nexus_workflow/dag.md index 009b661..fdd0f1b 100644 --- a/nexus-next/packages/reference/nexus_workflow/dag.md +++ b/nexus-next/packages/reference/nexus_workflow/dag.md @@ -2079,6 +2079,3 @@ Will emit an event if the execution is done.
fun if_finished_emit_final_event(self: &(nexus_workflow=0x0)::dag::DAGExecution)
 
- - - diff --git a/nexus-next/packages/reference/nexus_workflow/default_gas_extension.md b/nexus-next/packages/reference/nexus_workflow/default_gas_extension.md index a01d823..3343f30 100644 --- a/nexus-next/packages/reference/nexus_workflow/default_gas_extension.md +++ b/nexus-next/packages/reference/nexus_workflow/default_gas_extension.md @@ -153,6 +153,3 @@ Disables this extension.
public fun disable_expiry(gas_service: &mut (nexus_workflow=0x0)::gas::GasService, tool_registry: &(nexus_workflow=0x0)::tool_registry::ToolRegistry, owner_cap: &(nexus_primitives=0x0)::owner_cap::CloneableOwnerCap<(nexus_workflow=0x0)::gas::OverGas>, fqn: std::ascii::String, ctx: &mut sui::tx_context::TxContext)
 
- - - diff --git a/nexus-next/packages/reference/nexus_workflow/default_sap.md b/nexus-next/packages/reference/nexus_workflow/default_sap.md index b776a28..b924f8e 100644 --- a/nexus-next/packages/reference/nexus_workflow/default_sap.md +++ b/nexus-next/packages/reference/nexus_workflow/default_sap.md @@ -282,3 +282,4 @@ One calls this after workflow contract is done with advancing the DAG. + diff --git a/nexus-next/packages/reference/nexus_workflow/gas.md b/nexus-next/packages/reference/nexus_workflow/gas.md index c7abe37..7914c24 100644 --- a/nexus-next/packages/reference/nexus_workflow/gas.md +++ b/nexus-next/packages/reference/nexus_workflow/gas.md @@ -1092,6 +1092,3 @@ amount requested.
fun get_or_insert_tool_gas_mut(self: &mut (nexus_workflow=0x0)::gas::GasService, fqn: std::ascii::String, ctx: &mut sui::tx_context::TxContext): &mut (nexus_workflow=0x0)::gas::ToolGas
 
- - - diff --git a/nexus-next/packages/reference/nexus_workflow/leader_cap.md b/nexus-next/packages/reference/nexus_workflow/leader_cap.md index be12a7f..9fc3f7a 100644 --- a/nexus-next/packages/reference/nexus_workflow/leader_cap.md +++ b/nexus-next/packages/reference/nexus_workflow/leader_cap.md @@ -105,6 +105,3 @@ Creates a founding [CloneableOwnerCap] with a random network ID.
public entry fun create_for_self_and_addresses(n_per_address: u64, addresses: vector<address>, ctx: &mut sui::tx_context::TxContext)
 
- - - diff --git a/nexus-next/packages/reference/nexus_workflow/main.md b/nexus-next/packages/reference/nexus_workflow/main.md index 706cd59..7a46a04 100644 --- a/nexus-next/packages/reference/nexus_workflow/main.md +++ b/nexus-next/packages/reference/nexus_workflow/main.md @@ -99,6 +99,3 @@ Amount of leader caps to clone per [DEV_ADDRESSES] address.
fun init(ctx: &mut sui::tx_context::TxContext)
 
- - - diff --git a/nexus-next/packages/reference/nexus_workflow/tool_registry.md b/nexus-next/packages/reference/nexus_workflow/tool_registry.md index 3103e5c..c296928 100644 --- a/nexus-next/packages/reference/nexus_workflow/tool_registry.md +++ b/nexus-next/packages/reference/nexus_workflow/tool_registry.md @@ -740,6 +740,3 @@ Has the tool been unregistered for longer than the lock duration?
fun did_unregister_period_pass_(self: &(nexus_workflow=0x0)::tool_registry::OffChainTool, clock: &sui::clock::Clock): bool
 
- - - diff --git a/nexus-next/packages/workflow.md b/nexus-next/packages/workflow.md index 83a0038..d6b6f33 100644 --- a/nexus-next/packages/workflow.md +++ b/nexus-next/packages/workflow.md @@ -228,3 +228,4 @@ The amount of `SUI` locked and the interval after which they can be reclaimed is This trade-off was deemed worthy. - When using the `ProofOfUid` primitive, it must be created with a type that matches the `UID`. The type should be considered an authorization ticket and should be treated just as any other capability type. + diff --git a/nexus-next/tool.md b/nexus-next/tool.md index 4b62811..e07d83c 100644 --- a/nexus-next/tool.md +++ b/nexus-next/tool.md @@ -75,3 +75,4 @@ Coming soon. ## Tool authorization Once there are community Tools, we will need a way to authorize communication between the Leader and a Tool. This has been discussed superficially and it needs to be researched in depth in the future. + diff --git a/nexus-sdk/cli.md b/nexus-sdk/cli.md index cacb3c2..5b9a3fa 100644 --- a/nexus-sdk/cli.md +++ b/nexus-sdk/cli.md @@ -1,6 +1,6 @@ # Nexus CLI -> concerns [`nexus-cli` repo][nexus-cli-repo] +> concerns [`nexus-cli` repo](https://github.com/Talus-Network/nexus-sdk/tree/main/cli) The Nexus CLI is a set of tools that is used by almost all Actors in the Nexus ecosystem. @@ -158,7 +158,7 @@ This command requires that a wallet is connected to the CLI... --- -**`nexus dag execute --dag-id --input-json --entry-group [group] [--inspect]`** +**`nexus dag execute --dag-id --input-json --entry-group [group] --encrypt [vertex1.port1 vertex2.port2] [--inspect]`** Execute a DAG with the provided ``. This command also accepts an entry `` of vertices to be invoked. Find out more about entry groups in [[Package: Workflow]]. Entry `` defaults to a starndardized `_default_group` string. @@ -168,6 +168,8 @@ The input `` is a JSON string with the following structure: - Each top-level value is an object and its keys refer to the _input port names_ of each vertex (this object can be empty if the vertex has no input ports) - Values of the second-level object are the data that should be passed to each input port +The `--encrypt` argument accepts a space-separated list of `vertex.port` pairs. The data on these ports will be encrypted before being sent to the chain. + The `--inspect` argument automatically triggers `nexus dag inspect-execution` upon submitting the execution transaction. {% hint style="info" %} @@ -258,6 +260,3 @@ This command requires that a wallet is connected to the CLI... Provides completion for some well-known shells. - - -[nexus-cli-repo]: https://github.com/Talus-Network/nexus-sdk/tree/main/cli diff --git a/nexus-sdk/guides/dag-construction.md b/nexus-sdk/guides/dag-construction.md index 1471ff6..e3725b4 100644 --- a/nexus-sdk/guides/dag-construction.md +++ b/nexus-sdk/guides/dag-construction.md @@ -2,7 +2,7 @@ This guide explains how to construct DAG (Directed Acyclic Graph) JSON files for the Nexus platform. DAGs define the workflow that an Agent will execute. -For an explanation of the terms and rules used below, refer to [the Nexus workflow documentation][nexus-next-workflow]. +For an explanation of the terms and rules used below, refer to [the Nexus workflow documentation](../../nexus-next/packages/workflow.md). {% hint style="info"%} Note that for all DAG related terms in the configuration JSON file, snake casing is applied. @@ -38,11 +38,14 @@ A DAG JSON file consists of sections defining the graph's components: ``` - The `name` must be unique within the DAG. + {% hint style="success" %} The input ports of a tool are specified by the tool's output schema saved in the Nexus tool registry. Each input port must have exactly one of: - 1. An edge leading to it - 2. A default value - 3. Be part of `entry_ports` + +1. An edge leading to it +2. A default value +3. Be part of `entry_ports` + {% endhint %} - Add the input port as part of `entry_ports` only if it does not have an edge leading into it nor has a default value. @@ -60,7 +63,8 @@ Edges define the flow of data between vertices, connecting an output port of a s "from": { "vertex": "source_vertex_name", // Name from the "vertices" list "output_variant": "ok", // e.g., ok, err, gt, lt, eq - "output_port": "output_port_name" + "output_port": "output_port_name", + "encrypted": true // Optional, default is false }, "to": { "vertex": "target_vertex_name", // Name from the "vertices" list @@ -71,6 +75,7 @@ Edges define the flow of data between vertices, connecting an output port of a s - The `source_vertex_name` and `target_vertex_name` refer to the `name` field of vertices defined in the `vertices` list. - The `target_input_port_name` must be a valid input port for the tool used by the `target_vertex_name`. +- If the `encrypted` field is set to `true`, the data will be encrypted before being sent on-chain. This is useful for sensitive data that should not be exposed in plaintext. ## 4. Default Values @@ -78,19 +83,19 @@ Default values provide static inputs to vertices: ```json { - "vertex": "vertex_name", // References a name from the "vertices" list + "vertex": "vertex_name", // References a name from the "vertices" list "input_port": "port_name", "value": { "storage": "inline", - "data": value // This is a JSON value + "data": value, // This is a JSON value } } ``` **Important Constraints:** -- An _input port_ can receive data either from an _incoming edge_ or a _default value_, but **never both**. ([workflow rules][nexus-next-workflow] Rule 4) -- Entry ports **cannot** have default values (by definition). Default values are only permitted for input ports that are _not_ entry ports. ([workflow rules][nexus-next-workflow] Rule 11) +- An _input port_ can receive data either from an _incoming edge_ or a _default value_, but **never both**. ([workflow rules](../../nexus-next/packages/workflow.md) Rule 4) +- Entry ports **cannot** have default values (by definition). Default values are only permitted for input ports that are _not_ entry ports. ([workflow rules](../../nexus-next/packages/workflow.md) Rule 11) ## 5. Entry Groups (Optional) @@ -114,9 +119,28 @@ Being part of an entry group does not imply that all vertices in the group get e {% endhint %} Practically speaking, this means that you'll need to add all vertices to the entry group that either (non-exclusive): + - will immediately start execution - need to be provided client input for entry ports +## 6. Outputs (Optional) + +Outputs can be defined on vertices that have no outgoing edges. These can be thought of as the return values of a DAG execution. Only ports that are specified here will be part of the `EndStateReachedEvent` emitted by the DAG execution. + +```json +{ + "vertex": "vertex_name", // Name must exist in the `vertices` list + "output_variant": "ok", // e.g., ok, err, gt, lt, eq + "output_port": "output_port_name", // e.g., result + "encrypted": true // Optional, default is false +} +``` + +**Important Constraints:** + +- DAG construction will fail if you attempt to add an output on a vertex that has outgoing edges. +- Only data from ports that are specified here or in the `edges` field will flow onchain. + ### Summary - An _entry group_ allows selecting a specific starting configuration of the workflow with selected entry points via `nexus dag execute --entry-group group_name ...`. @@ -126,11 +150,11 @@ Practically speaking, this means that you'll need to add all vertices to the ent - A default entry group can be named `_default_group`. This group is used when no `--entry-group` flag is provided during execution. - If no _entry group_ is specified, all vertices that have _entry ports_ are considered part of the `_default_group`. -## 6. Validation Rules +## 7. Validation Rules -The [Nexus CLI][nexus-cli] (`nexus dag validate`) performs static analysis to enforce the critical rules defined in [workflow rules][nexus-next-workflow]. +The [Nexus CLI](../cli.md) (`nexus dag validate`) performs static analysis to enforce the critical rules defined in [workflow rules](../../nexus-next/packages/workflow.md). -## 7. Best Practices +## 8. Best Practices 1. **Naming Conventions**: @@ -152,7 +176,7 @@ The [Nexus CLI][nexus-cli] (`nexus dag validate`) performs static analysis to en - Document the purpose of each vertex. - Refer to the tool documentation for the expected input/output formats for each vertex. -## 8. Example Workflow +## 9. Example Workflow Here's a step-by-step process to create a DAG: @@ -189,7 +213,7 @@ Here's a step-by-step process to create a DAG: - Verify all connections - Test with sample inputs -## 9. Examples +## 10. Examples For working examples, see the following files in the `cli/src/dag/_dags` directory: @@ -200,10 +224,5 @@ For working examples, see the following files in the `cli/src/dag/_dags` directo - `ig_story_planner_valid.json`: Example of a complex workflow - `entry_groups_valid.json`: Example of using entry groups. -For examples of invalid DAGs and common mistakes to avoid (especially regarding Rule 5 - Race Conditions), see the diagrams in [workflow documentation][nexus-next-workflow] and the `*_invalid.json` files in the [testing DAG directory][example-dags]. - - +For examples of invalid DAGs and common mistakes to avoid (especially regarding Rule 5 - Race Conditions), see the diagrams in [workflow documentation](../../nexus-next/packages/workflow.md) and the `*_invalid.json` files in the [testing DAG directory](https://github.com/Talus-Network/nexus-sdk/tree/v0.1.0/cli/src/dag/_dags). -[nexus-next-workflow]: ../../nexus-next/packages/workflow.md -[example-dags]: https://github.com/Talus-Network/nexus-sdk/tree/v0.1.0/cli/src/dag/_dags -[nexus-cli]: ../cli.md diff --git a/nexus-sdk/guides/llm-openai-chat-prep-tool.md b/nexus-sdk/guides/llm-openai-chat-prep-tool.md index 998871c..ac96010 100644 --- a/nexus-sdk/guides/llm-openai-chat-prep-tool.md +++ b/nexus-sdk/guides/llm-openai-chat-prep-tool.md @@ -3,9 +3,10 @@ This guide walks through the development of a tool that converts numbers into a message format compatible with the OpenAI chat completion tool. This is particularly useful when you want to use the results of mathematical operations from the [math tool](../../tools/math/README.md) as input for the [chat completion tool](../../tools/llm-openai-chat-completion/README.md). {% hint style="info" %} Prerequisites -* Follow the [setup guide](setup.md) to make sure you've got the [Nexus CLI](../cli.md) installed. -* Read the [Toolkit Rust](../toolkit-rust.md) and [Tool development](../tool-development.md) docs that provide more context. -{% endhint %} + +- Follow the [setup guide](setup.md) to make sure you've got the [Nexus CLI](../cli.md) installed. +- Read the [Toolkit Rust](../toolkit-rust.md) and [Tool development](../tool-development.md) docs that provide more context. + {% endhint %} ## Project Setup @@ -318,6 +319,14 @@ This tool is typically used in a DAG to convert the output of a mathematical ope } } } + ], + "outputs": [ + { + "vertex": "chat", + "output_variant": "ok", + "output_port": "message", + "encrypted": false + } ] } ``` @@ -363,3 +372,4 @@ Consider for what use cases you could use this tool to prepare it to add as an L ## Next Steps This tool provides a simple but essential bridge between mathematical operations and chat completion, enabling the creation of more sophisticated DAGs that combine numerical computation with natural language processing. Follow along with the developer guides to expand the [Math Branching Example DAG with LLM chat completion](math-branching-with-chat.md). + diff --git a/nexus-sdk/guides/math-branching-dag-builder.md b/nexus-sdk/guides/math-branching-dag-builder.md index 0652e41..92a175c 100644 --- a/nexus-sdk/guides/math-branching-dag-builder.md +++ b/nexus-sdk/guides/math-branching-dag-builder.md @@ -255,7 +255,34 @@ We provide the constant values needed for the operations. - Each entry specifies the `vertex` and `input_port` to receive the value. - `"storage": "inline"` means the `data` is directly embedded in the DAG definition. -### 4. Entry Points (Implicit Default) +### 4. Specify outputs (`outputs` list) + +In order to access the final result of the DAG, we need to define outputs for the vertices that do not have outgoing edges. In this case, all our math operations have an output port named `result`, so we can define them as follows: + +```json +{ + // ... other sections ... + "outputs": [ + { + "vertex": "mul_by_neg_3", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "mul_by_7", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "add_1", + "output_variant": "ok", + "output_port": "result" + } + ] +} +``` + +### 5. Entry Points (Implicit Default) Since we haven't defined an `entry_groups` section, Nexus uses the default entry mechanism, i.e. `_default_group`. It identifies vertices that have entry ports specified. @@ -401,6 +428,23 @@ Combining these sections gives us the complete `math_branching.json`: "input_port": "a" } } + ], + "outputs": [ + { + "vertex": "mul_by_neg_3", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "mul_by_7", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "add_1", + "output_variant": "ok", + "output_port": "result" + } ] // No "entry_groups" section needed, default mechanism applies. } @@ -433,3 +477,4 @@ This example showcases how to combine simple tools and DAG structure definitions ## Up Next Want to extend this example? Follow the next part of the guide to see how we can add another entry point to the DAG and manage this through entry groups. + diff --git a/nexus-sdk/guides/math-branching-dag-entry.md b/nexus-sdk/guides/math-branching-dag-entry.md index 92e77cb..d29a1bf 100644 --- a/nexus-sdk/guides/math-branching-dag-entry.md +++ b/nexus-sdk/guides/math-branching-dag-entry.md @@ -1,6 +1,6 @@ # Extending Your DAG with Entry Groups -This guide builds on the [Build the Quickstart guide][math-branching-dag-builder-guide] by extending the example to support multiple entry points using entry groups. You'll take the original [`math_branching.json`](https://github.com/Talus-Network/nexus-sdk/blob/v0.1.0/cli/src/dag/_dags/math_branching.json) DAG and add an alternative entry path that allows users to directly provide two numbers for multiplication instead of adding a constant to the input. +This guide builds on the [Build the Quickstart guide](./math-branching-dag-builder.md) by extending the example to support multiple entry points using entry groups. You'll take the original [`math_branching.json`](https://github.com/Talus-Network/nexus-sdk/blob/v0.1.0/cli/src/dag/_dags/math_branching.json) DAG and add an alternative entry path that allows users to directly provide two numbers for multiplication instead of adding a constant to the input. {% hint style="info" %} Prerequisites Follow the [setup guide](setup.md) to get properly setup in case you haven't. @@ -273,6 +273,33 @@ We'll keep the same default values as the original DAG: } ``` +### 4. Specify outputs (`outputs` list) + +Outputs will also remain identical. + +```json +{ + // ... other sections ... + "outputs": [ + { + "vertex": "mul_by_neg_3", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "mul_by_7", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "add_1", + "output_variant": "ok", + "output_port": "result" + } + ] +} +``` + Notice that we do not add any default values for the `mul_inputs` vertex, as both its input ports will be provided by the user. ### 4. Define Entry Groups (`entry_groups` list) @@ -464,6 +491,23 @@ Combining these sections gives us the complete `math_branching_entry_group.json` "name": "mul_entry", "vertices": ["mul_inputs"] } + ], + "outputs": [ + { + "vertex": "mul_by_neg_3", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "mul_by_7", + "output_variant": "ok", + "output_port": "result" + }, + { + "vertex": "add_1", + "output_variant": "ok", + "output_port": "result" + } ] } ``` @@ -536,9 +580,5 @@ In this guide, we extended our original branching math DAG to support multiple e Entry groups are a powerful feature of Nexus DAGs that enable more flexible and modular workflows while maintaining the safety guarantees of the DAG execution model. They allow a single DAG to support multiple different starting states and input combinations while preventing potential race conditions. -For more advanced usage of entry groups and other DAG features, refer to the [DAG Construction Guide][dag-construction]. - - +For more advanced usage of entry groups and other DAG features, refer to the [DAG Construction Guide](./dag-construction.md). -[dag-construction]: ./dag-construction.md -[math-branching-dag-builder-guide]: ./math-branching-dag-builder.md diff --git a/nexus-sdk/guides/math-branching-quickstart.md b/nexus-sdk/guides/math-branching-quickstart.md index 14ec92f..a839728 100644 --- a/nexus-sdk/guides/math-branching-quickstart.md +++ b/nexus-sdk/guides/math-branching-quickstart.md @@ -143,3 +143,4 @@ When you execute the DAG via the `nexus dag execute` command, a successful outpu * Read the full [Agent Builder Guide](math-branching-dag-builder.md) to understand how this DAG is constructed * Study the [DAG Construction Guide](dag-construction.md) for more advanced DAG features * Try building your own DAG with different tools and logic flows + diff --git a/nexus-sdk/guides/math-branching-with-chat.md b/nexus-sdk/guides/math-branching-with-chat.md index b4e388a..6a28f6f 100644 --- a/nexus-sdk/guides/math-branching-with-chat.md +++ b/nexus-sdk/guides/math-branching-with-chat.md @@ -1,6 +1,6 @@ # Extending the Math Branching DAG with Chat Completion -This guide builds on the [Math Branching DAG with Entry Groups][math-branching-entry-guide] by adding a chat completion tool that explains the mathematical results. You'll learn how to: +This guide builds on the [Math Branching DAG with Entry Groups](./math-branching-dag-entry.md) by adding a chat completion tool that explains the mathematical results. You'll learn how to: 1. Understand the need for a custom tool to bridge between math operations and chat completion 2. Add the chat completion tool to the DAG @@ -15,7 +15,7 @@ Follow the [setup guide](setup.md) to get properly setup in case you haven't. Before you can connect our math operations to the chat completion tool, you need to understand a key challenge: type safety. The [LLM chat completion tool](../../tools/llm-openai-chat-completion/README.md)expects a `Message` struct as input, but the [math tool](../../tools/math/README.md) outputs numbers. You can't directly connect these without proper type conversion. -This is where you need a custom tool to bridge this gap. You'll use the `xyz.taluslabs.llm.openai.chat-prep@1` tool that you developed in the [Build the Missing Tool guide][llm-openai-chat-prep-tool]. This tool converts numbers into the proper message format that the chat completion tool expects. +This is where you need a custom tool to bridge this gap. You'll use the `xyz.taluslabs.llm.openai.chat-prep@1` tool that you developed in the [Build the Missing Tool guide](./llm-openai-chat-prep-tool.md). This tool converts numbers into the proper message format that the chat completion tool expects. ## Step 1: Adding the Required Tools @@ -169,6 +169,22 @@ You need to set up default values for both tools: } ``` +## Step 5: Updating DAG outputs + +We can no longer assign outputs to be on the math tools because they now have outgoing edges. Instead our new output will be the chat completion tool: + +```json +{ + "outputs": [ + { + "vertex": "chat_completion", + "output_variant": "ok", + "output_port": "completion" + } + ] +} +``` + ## Step 5: Updating Entry Groups You need to add the `chat_completion` to our entry groups: @@ -517,6 +533,13 @@ Here's the complete DAG definition that combines all the components we've discus "name": "mul_entry", "vertices": ["mul_inputs", "chat_completion"] } + ], + "outputs": [ + { + "vertex": "chat_completion", + "output_variant": "ok", + "output_port": "completion" + } ] } ``` @@ -546,13 +569,13 @@ For testing, you can use the Nexus CLI to execute the DAG: nexus dag execute --dag-id --entry-group add_entry --input-json '{ "add_input_and_default": {"a": 10}, "chat_completion": {"api_key": "your-api-key"} -}' --inspect +}' --inspect --encrypt chat_completion.api_key # Using the multiplication entry group nexus dag execute --dag-id --entry-group mul_entry --input-json '{ "mul_inputs": {"a": 5, "b": 2}, "chat_completion": {"api_key": "your-api-key"} -}' --inspect +}' --inspect --encrypt chat_completion.api_key ``` The `--inspect` flag will show you detailed information about the execution, including: @@ -562,6 +585,8 @@ The `--inspect` flag will show you detailed information about the execution, inc - Any errors that occurred - The final chat completion response +The `--encrypt` flag is used to encrypt sensitive information, such as the API key, before sending it to the Nexus network. + ### 2. Integration with Applications To integrate this DAG into your application: @@ -619,7 +644,3 @@ This extended DAG demonstrates how to combine mathematical computation with natu This extended DAG demonstrates how to combine mathematical computation with natural language processing, creating a more interactive and engaging experience for users. - - -[math-branching-entry-guide]: ./math_branching-dag-entry.md -[llm-openai-chat-prep-tool]: ./llm-openai-chat-prep-tool.md diff --git a/nexus-sdk/guides/setup.md b/nexus-sdk/guides/setup.md index 3af262b..815a066 100644 --- a/nexus-sdk/guides/setup.md +++ b/nexus-sdk/guides/setup.md @@ -142,3 +142,4 @@ Open the [Talus Sui Explorer](https://explorer.devnet.taluslabs.dev/) and login --- After completing these steps, you are ready to build and execute workflows using the Nexus SDK. To build your first workflow, check the [Dev Quickstart guide](math-branching-quickstart.md). + diff --git a/nexus-sdk/guides/tool-firewall.md b/nexus-sdk/guides/tool-firewall.md index 4bb60b3..c4e017d 100644 --- a/nexus-sdk/guides/tool-firewall.md +++ b/nexus-sdk/guides/tool-firewall.md @@ -73,3 +73,4 @@ You should see entries indicating that connections from the specified IP address --- By following this guide, your Tool will be configured to accept connections only from the specified Leader nodes, enhancing the security of your deployment. + diff --git a/nexus-sdk/tool-development.md b/nexus-sdk/tool-development.md index 925a4af..7290c5a 100644 --- a/nexus-sdk/tool-development.md +++ b/nexus-sdk/tool-development.md @@ -70,3 +70,4 @@ Each Nexus Tool should have a clear and publicly accessible README file that des If using Rust, the `main.rs` file should include this documentation via `#![doc = include_str!("../path/to/README.md")]`. An example README file can be found [here](../tools/llm-openai-chat-completion/README.md). + diff --git a/nexus-sdk/toolkit-rust.md b/nexus-sdk/toolkit-rust.md index 94f23cd..4a0a280 100644 --- a/nexus-sdk/toolkit-rust.md +++ b/nexus-sdk/toolkit-rust.md @@ -1,6 +1,6 @@ # Nexus Toolkit for Rust -> concerns [`nexus-toolkit-rust` repo][nexus-toolkit-rust-repo] +> concerns [`nexus-toolkit-rust` repo](https://github.com/Talus-Network/nexus-sdk/tree/main/toolkit-rust) This library exports useful functionality to streamline the development of Nexus Tools in Rust. It is mainly used by **Tool developers** to bootstrap their efforts to extend the Nexus ecosystem. @@ -8,7 +8,7 @@ This documentation will go over the main features of the library and how to use ## Installation -Using the [CLI][nexus-cli-docs] run the `$ nexus tool new --help` command to see the available options. This command creates a fresh Rust project with the necessary dependencies to get started. +Using the [CLI](./cli.md) run the `$ nexus tool new --help` command to see the available options. This command creates a fresh Rust project with the necessary dependencies to get started. Alternatively, you can add the following to your `Cargo.toml` file: @@ -83,7 +83,7 @@ This associated type defines the output that the Tool produces. This type must d The Tool's output schema is then derived from this type via the `schemars::schema_for!` macro. -To comply with [Nexus Workflow output variants][nexus-next-workflow-docs], the output schema **must include a top-level `oneOf`**. This is also enforced by the Tool's runtime and achievable in Rust simply by using an `enum`. +To comply with [Nexus Workflow output variants](../nexus-next/packages/workflow.md), the output schema **must include a top-level `oneOf`**. This is also enforced by the Tool's runtime and achievable in Rust simply by using an `enum`. ```rs use nexus_toolkit::*; @@ -106,7 +106,7 @@ impl NexusTool for HttpStatus { #### `NexusTool::fqn` -Defines the Tool's fully qualified name. This is used to uniquely identify the Tool in the Nexus ecosystem. Read more about FQNs in the [Nexus Tool documentation][nexus-next-tool-docs]. +Defines the Tool's fully qualified name. This is used to uniquely identify the Tool in the Nexus ecosystem. Read more about FQNs in the [Nexus Tool documentation](../nexus-next/tool.md). ```rs use nexus_toolkit::*; @@ -183,7 +183,7 @@ Notice that the `invoke` function does not return a `Result`. This is because er ### `nexus_toolkit::bootstrap!` The `bootstrap!` macro hides away the boilerplate code needed to create the -underlying HTTP server that adheres to the [Nexus Tool interface][nexus-next-tool-docs]. +underlying HTTP server that adheres to the [Nexus Tool interface](../nexus-next/tool.md). It has a flexible interface that accepts an `Into` value and a struct that `impl NexusTool`. @@ -223,9 +223,3 @@ async fn main() { } ``` - - -[nexus-toolkit-rust-repo]: https://github.com/Talus-Network/nexus-sdk/tree/main/toolkit-rust -[nexus-next-tool-docs]: ../nexus-next/tool.md -[nexus-next-workflow-docs]: ../nexus-next/packages/workflow.md -[nexus-cli-docs]: ./cli.md diff --git a/tools/social-twitter/README.md b/tools/social-twitter/README.md index 03aa530..625e760 100644 --- a/tools/social-twitter/README.md +++ b/tools/social-twitter/README.md @@ -316,7 +316,7 @@ Twitter api [reference](https://docs.x.com/x-api/tweets/post-tweet) ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -325,7 +325,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`text`: [`String`]** @@ -429,7 +429,7 @@ Twitter api [reference](https://docs.x.com/x-api/posts/post-delete-by-post-id#po ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -438,7 +438,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`tweet_id`: [`String`]** @@ -486,7 +486,7 @@ Twitter api [reference](https://docs.x.com/x-api/posts/causes-the-user-in-the-pa ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -495,7 +495,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -536,7 +536,7 @@ Twitter api [reference](https://docs.x.com/x-api/posts/causes-the-user-in-the-pa ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -545,7 +545,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -586,7 +586,7 @@ Twitter api [reference](https://docs.x.com/x-api/media/quickstart/media-upload-c ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -595,7 +595,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`media_data`: [`String`]** @@ -696,9 +696,9 @@ The media upload failed. The media upload must follow these validation rules: 1. Media data must be valid Base64 encoded content -2. Media type must be one of the supported types -3. Media category must be appropriate for the media type -4. Media size must be within Twitter's limits: +1. Media type must be one of the supported types +1. Media category must be appropriate for the media type +1. Media size must be within Twitter's limits: - Images: Up to 5MB - GIFs: Up to 15MB - Videos: Up to 512MB @@ -909,7 +909,7 @@ Twitter api [reference](https://docs.x.com/x-api/posts/causes-the-user-in-the-pa ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -918,7 +918,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -959,7 +959,7 @@ Twitter api [reference](https://docs.x.com/x-api/users/follow) ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -968,7 +968,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -1173,8 +1173,8 @@ The user was retrieved successfully. The user was not retrieved due to an error. - **`err.reason`: [`String`]** - The reason for the error. This could be: - - Twitter API error with title and error type (e.g., "Twitter API error: Not Found Error (type: https://api.twitter.com/2/problems/resource-not-found)") - - Twitter API error with optional detail and message (e.g., "Twitter API error: Not Found Error (type: https://api.twitter.com/2/problems/resource-not-found) - User not found") + - Twitter API error with title and error type (e.g., "Twitter API error: Not Found Error ([type](https://api.twitter.com/2/problems/resource-not-found))") + - Twitter API error with optional detail and message (e.g., "Twitter API error: Not Found Error ([type](https://api.twitter.com/2/problems/resource-not-found) - User not found")) - Network error (e.g., "Network error: network error: Connection refused") - Response parsing error (e.g., "Response parsing error: expected value at line 1 column 1") - Status code error (e.g., "Twitter API status error: 429 Too Many Requests") @@ -1372,7 +1372,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/lists/ ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1381,7 +1381,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`name`: [`String`]** @@ -1411,7 +1411,7 @@ The list was created successfully. The list creation failed. - **`err.reason`: [`String`]** - The reason for the error. This could be: - - Twitter API error (e.g., "Twitter API error: Not Found Error (type: https://api.twitter.com/2/problems/resource-not-found)") + - Twitter API error (e.g., "Twitter API error: Not Found Error ([type](https://api.twitter.com/2/problems/resource-not-found))") - Network error (e.g., "Network error: network error: Connection refused") - Response parsing error - Status code error @@ -1426,7 +1426,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/lists/ ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1435,7 +1435,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`list_id`: [`String`]** @@ -1698,7 +1698,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/lists/ ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1707,7 +1707,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`list_id`: [`String`]** @@ -1753,7 +1753,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/lists/ ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1762,7 +1762,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`list_id`: [`String`]** @@ -1778,7 +1778,7 @@ The ID of the user to add to the list. The user was successfully added to the list. -- \*\*`ok.is_member` +- **`ok.is_member`** - **`ok.is_member`** - Confirmation that the user is a member of the list (true). **`err`** @@ -1801,7 +1801,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/lists/ ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1810,7 +1810,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`list_id`: [`String`]** @@ -1848,7 +1848,7 @@ Twitter api [reference](https://docs.x.com/x-api/posts/causes-the-user-in-the-pa ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -1857,7 +1857,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -2015,7 +2015,7 @@ Twitter api [reference](https://docs.x.com/x-api/users/unfollow) ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2024,7 +2024,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`user_id`: [`String`]** @@ -2150,7 +2150,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/direct ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2159,7 +2159,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`participant_id`: [`String`]** @@ -2209,7 +2209,7 @@ Standard Nexus Tool that retrieves direct messages from a conversation. Twitter ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2218,7 +2218,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`participant_id`: [`String`]** @@ -2309,7 +2309,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/direct ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2318,7 +2318,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`conversation_id`: [`String`]** @@ -2401,7 +2401,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/direct ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2410,7 +2410,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`conversation_type`: [`ConversationType`]** @@ -2468,7 +2468,7 @@ The group conversation creation failed. The message must follow these validation rules: 1. Either `text` or `media_ids` must be provided and non-empty -2. If `media_ids` is provided, it must not be empty (for `Many` variant) +1. If `media_ids` is provided, it must not be empty (for `Many` variant) --- @@ -2479,7 +2479,7 @@ Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/direct ## Input -**Authentication Parameters** +### Authentication Parameters The following authentication parameters are provided as part of the TwitterAuth structure: @@ -2488,7 +2488,7 @@ The following authentication parameters are provided as part of the TwitterAuth - **`access_token`: [`String`]** - Access Token for user's Twitter account - **`access_token_secret`: [`String`]** - Access Token Secret for user's Twitter account -**Additional Parameters** +### Additional Parameters **`dm_conversation_id`: [`String`]** @@ -2540,7 +2540,7 @@ The message sending failed. The message must follow these validation rules: 1. Either `text` or `media_ids` must be provided and non-empty -2. If `media_ids` is provided, it must not be empty (for `Many` variant) +1. If `media_ids` is provided, it must not be empty (for `Many` variant) ## Example Error Messages @@ -2577,8 +2577,8 @@ The `err.kind` field provides a categorized error type for easier programmatic h Each error includes three primary components: 1. **`kind` (TwitterErrorKind)**: The categorized error type (as described above) -2. **`reason` (String)**: A descriptive message that provides details about the error -3. **`status_code` (Option)**: The HTTP status code returned by Twitter API, if available +1. **`reason` (String)**: A descriptive message that provides details about the error +1. **`status_code` (Option)**: The HTTP status code returned by Twitter API, if available ### Common Status Codes