Skip to content

Repair incomplete JSON (e.g. from streaming APIs or AI models) so it can be parsed as it's received.

License

Notifications You must be signed in to change notification settings

m1guelpf/repair-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repair_json

Repair incomplete JSON (e.g. from streaming APIs or AI models) so it can be parsed as it's received.

crates.io download count badge docs.rs

Usage

let json_stream = json_source::stream().await?;

while let Some(incomplete_json) = json_stream.next().await {
    let valid_json = repair_json::repair(incomplete_json);
    let parsed_struct = serde_json::from_str(valid_json).unwrap();

    // ...
}

Refer to the documentation on docs.rs for detailed usage instructions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Repair incomplete JSON (e.g. from streaming APIs or AI models) so it can be parsed as it's received.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages