- Notifications
You must be signed in to change notification settings - Fork328
Update all dependencies#1668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
49c24b2
c727c01
0bca7ff
51a3646
df5bb58
9d65add
fb91af4
7ad0814
f4c609d
ea788db
9186c9f
d5485c9
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
use anyhow::Result; | ||
use pyo3::prelude::*; | ||
use pyo3::ffi::c_str; | ||
use pyo3::types::PyString; | ||
use crate::create_pymodule; | ||
create_pymodule!("/src/bindings/langchain/langchain.py"); | ||
pub fn chunk(splitter: &str, text: &str, kwargs: &serde_json::Value) -> Result<Vec<String>> { | ||
Python::with_gil(|py| -> Result<Vec<String>> { | ||
let chunk: Py<PyAny> = get_module!(PY_MODULE).getattr(py, "chunk")?; | ||
let splitter = PyString::new(py, splitter); | ||
let text = PyString::new(py, text); | ||
let kwargs = PyString::new(py, serde_json::to_string(kwargs)?.as_str()); | ||
Ok(chunk | ||
.call1(py,(splitter, text, kwargs))? | ||
.extract(py)?) | ||
}) | ||
} |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.