{"id":22752010,"url":"https://github.com/aandreba/rustygen","last_synced_at":"2025-09-07T14:07:30.913Z","repository":{"id":211953230,"uuid":"730260459","full_name":"Aandreba/rustygen","owner":"Aandreba","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-11T18:44:04.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-04T11:48:41.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aandreba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-11T14:42:15.000Z","updated_at":"2024-11-16T11:09:45.000Z","dependencies_parsed_at":"2023-12-11T19:50:52.482Z","dependency_job_id":null,"html_url":"https://github.com/Aandreba/rustygen","commit_stats":null,"previous_names":["aandreba/rustygen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aandreba/rustygen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Frustygen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Frustygen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Frustygen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Frustygen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aandreba","download_url":"https://codeload.github.com/Aandreba/rustygen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aandreba%2Frustygen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274046000,"owners_count":25212982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T05:09:19.283Z","updated_at":"2025-09-07T14:07:30.888Z","avatar_url":"https://github.com/Aandreba.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rustygen - A Rusty version of autogen\n\n## Examples\n\n**Basic**\n\n```rust\nuse rustygen::{assistants::gpt::ChatGPT, record::ChatRecord, Conversation, MainConversation};\nuse libopenai::Client;\n\n#[tokio::main]\nasync fn main() -\u003e color_eyre::Result\u003c()\u003e {\n    let _ = color_eyre::install();\n    dotenv::dotenv()?;\n    let client = Client::new(None, None)?;\n\n    let mut conversation = MainConversation::\u003cChatRecord\u003e::new()\n        .agent(String::from(\"Tell me about yourself\"))\n        .agent(ChatGPT::new(\"gpt-3.5-turbo\", client));\n\n    println!(\"{:#?}\", conversation.play().await?);\n    return Ok(());\n}\n\n```\n\n**Chess**\n\n```rust\nuse rustygen::{\n    agent::Agent,\n    assistants::{\n        chess::ChessEngine,\n        gpt::{ChessError, ChessGPT},\n    },\n    Conversation, MainConversation,\n};\nuse chess::Action;\nuse libopenai::Client;\nuse std::time::Duration;\n\n#[tokio::main]\nasync fn main() -\u003e color_eyre::Result\u003c()\u003e {\n    let _ = color_eyre::install();\n    dotenv::dotenv()?;\n    let client = Client::new(None, None)?;\n\n    let mut i = 0;\n    let mut conversation = MainConversation::\u003cchess::Game\u003e::new()\n        .while_loop(|game| {\n            println!(\"Round {i}\");\n            i += 1;\n            game.result().is_none()\n        })\n        .agent(ChessEngine::new(\"./stockfish-ubuntu-x86-64\", Duration::from_secs(1)).await?)\n        .agent(\n            ChessGPT::new(\"gpt-3.5-turbo\", client, 5).catch(|e| async move {\n                match e {\n                    // Fall back to Stockfish whenever ChatGPT fails generating a legal move\n                    ChessError::NoLegalMoveFound =\u003e {\n                        println!(\"Resorting to Stockfish for GPT's move\");\n                        Ok(\n                            ChessEngine::new(\"./stockfish-ubuntu-x86-64\", Duration::from_secs(1))\n                                .await\n                                .unwrap(),\n                        )\n                    }\n                    e =\u003e Err(e),\n                }\n            }),\n        )\n        .end_while();\n\n    let mut game = chess::Game::new();\n    if let Err(e) = conversation.play_with(\u0026mut game).await {\n        eprintln!(\"{e}\");\n    }\n\n    for action in game.actions() {\n        match action {\n            Action::MakeMove(x) =\u003e println!(\"{x}\"),\n            other =\u003e println!(\"{other:?}\"),\n        }\n    }\n\n    println!(\"{}\", game.current_position().to_string());\n    return Ok(());\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faandreba%2Frustygen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faandreba%2Frustygen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faandreba%2Frustygen/lists"}