MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / markdown

Method markdown

python/src/text_splitter/config.rs:173–193  ·  view source on GitHub ↗
(chunk_size: usize, chunk_overlap: usize, split_by_headers: bool)

Source from the content-addressed store, hash-verified

171 #[staticmethod]
172 #[pyo3(signature = (chunk_size, chunk_overlap=0, split_by_headers=true))]
173 fn markdown(chunk_size: usize, chunk_overlap: usize, split_by_headers: bool) -> PyResult<Self> {
174 if chunk_size == 0 {
175 return Err(PyErr::new::<pyo3::exceptions::PyValueError, _>(
176 "Chunk size must be greater than 0",
177 ));
178 }
179
180 Ok(Self {
181 inner: CoreTextSplitterConfig {
182 strategy: CoreSplitterStrategy::Markdown {
183 chunk_size,
184 chunk_overlap,
185 split_by_headers,
186 },
187 preserve_word_boundaries: true,
188 trim_whitespace: true,
189 include_metadata: true,
190 extra_params: HashMap::new(),
191 },
192 })
193 }
194
195 /// Create a code splitter configuration
196 #[staticmethod]

Callers 3

app.pyFile · 0.80
chatbot.pyFile · 0.80

Calls

no outgoing calls

Tested by 1