feat: allow missing name/args in FunctionCallData and add streamed argument fields (#12) #17
Reference in New Issue
Block a user
Delete Branch "feat/function-call-optional-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #12
Summary
#[serde(default)]toFunctionCallData::nameandFunctionCallData::argsso missing fields deserialize gracefully rather than erroring:{"name": "f"}) deserialize withargs: Value::Null.{"partialArgs": [], "willContinue": true}) deserialize withname: ""andargs: Value::Null.name: Stringandargs: Valuetypes to ensure non-breaking backwards compatibility for existing callers.partial_args: Option<Vec<Value>>andwill_continue: Option<bool>toFunctionCallDatato support streamed function call chunks per the Vertex AIGoogleCloudAiplatformV1FunctionCallschema.#[serde(rename_all = "camelCase")],#[serde(skip_serializing_if)]for empty name and null args, and derivesDefault, PartialEq, EqonFunctionCallData.Part::with_partial_argsandPart::with_will_continuebuilder helpers.Testing
function_call_omits_unset_name_and_args_and_parses_missing_fieldsinsrc/types/common.rs:argsdeserialize and omitargswhen serialized.nameorargsdeserializepartialArgs/willContinueand omit unset fields when serialized.cargo test(33 passed) andcargo clippypass cleanly.