mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Organize context fragments (#18794)
Organize context fragments under `core/context`. Implement same trait on all of them.
This commit is contained in:
committed by
GitHub
Unverified
parent
ab26554a3a
commit
4c2e730488
@@ -0,0 +1,17 @@
|
||||
use super::ContextualUserFragment;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub(crate) struct UserInstructions {
|
||||
pub(crate) directory: String,
|
||||
pub(crate) text: String,
|
||||
}
|
||||
|
||||
impl ContextualUserFragment for UserInstructions {
|
||||
const ROLE: &'static str = "user";
|
||||
const START_MARKER: &'static str = "# AGENTS.md instructions for ";
|
||||
const END_MARKER: &'static str = "</INSTRUCTIONS>";
|
||||
|
||||
fn body(&self) -> String {
|
||||
format!("{}\n\n<INSTRUCTIONS>\n{}", self.directory, self.text)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user