Download codex-rs/chatgpt/src/get_task.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 891 Bytes
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/chatgpt/src/get_task.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/chatgpt/src/get_task.rs
-
curl -L -o get_task.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/chatgpt/src/get_task.rs
891 Bytes
| use codex_core::config::Config; | |
| use serde::Deserialize; | |
| use crate::chatgpt_client::chatgpt_get_request; | |
| pub struct GetTaskResponse { | |
| pub current_diff_task_turn: Option<AssistantTurn>, | |
| } | |
| // Only relevant fields for our extraction | |
| pub struct AssistantTurn { | |
| pub output_items: Vec<OutputItem>, | |
| } | |
| pub enum OutputItem { | |
| Pr(PrOutputItem), | |
| Other, | |
| } | |
| pub struct PrOutputItem { | |
| pub output_diff: OutputDiff, | |
| } | |
| pub struct OutputDiff { | |
| pub diff: String, | |
| } | |
| pub(crate) async fn get_task(config: &Config, task_id: String) -> anyhow::Result<GetTaskResponse> { | |
| let path = format!("/wham/tasks/{task_id}"); | |
| chatgpt_get_request(config, path).await | |
| } | |