You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
31
31
```
32
32
Already have Rust? Make sure it's up to date
33
-
```bash
33
+
```sh
34
34
rustup update
35
35
```
36
36
37
-
- (Recommended) Setup Python virtual environment:
38
-
```bash
37
+
- Setup Python virtual environment:
38
+
```sh
39
39
python3 -m venv .venv
40
40
```
41
41
Activate the virtual environment, before any installing / building / running:
42
42
43
-
```bash
43
+
```sh
44
44
. .venv/bin/activate
45
45
```
46
46
47
-
- Install maturin:
48
-
```bash
49
-
pip install maturin
47
+
- Install required tools:
48
+
```sh
49
+
pip install maturin mypy ruff
50
50
```
51
51
52
52
- Build the library. Run at the root of cocoindex directory:
53
-
```bash
53
+
```sh
54
54
maturin develop
55
55
```
56
56
57
-
- (Optional) Before running a specific example, set extra environment variables, for exposing extra traces, allowing dev UI, etc.
58
-
```bash
57
+
- Before running a specific example, set extra environment variables, for exposing extra traces, allowing dev UI, etc.
58
+
```sh
59
59
. ./.env.lib_debug
60
60
```
61
61
@@ -67,7 +67,12 @@ To submit your code:
67
67
1. Fork the [CocoIndex repository](https://github.com/cocoindex-io/cocoindex)
68
68
2. [Create a new branch](https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop) on your fork
69
69
3. Make your changes
70
-
4. [Open a Pull Request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) when your work is ready for review
70
+
4. Make sure all tests and linting pass by running
71
+
```sh
72
+
./check.sh
73
+
```
74
+
75
+
5. [Open a Pull Request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) when your work is ready for review
Copy file name to clipboardExpand all lines: src/lib_context.rs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,9 @@ impl LibContext {
110
110
.ok_or_else(|| anyhow!("Database is required for this operation. Please set COCOINDEX_DATABASE_URL environment variable and call cocoindex.init() with database settings."))
@@ -115,16 +115,20 @@ impl LlmGenerationClient for Client {
115
115
Ok(value) => {
116
116
println!("[Anthropic] Used permissive JSON5 parser for output");
117
117
serde_json::to_string(&value)?
118
-
},
119
-
Err(e2) => returnErr(anyhow::anyhow!(format!("No structured tool output or text found in response, and permissive JSON5 parsing also failed: {e}; {e2}")))
118
+
}
119
+
Err(e2) => {
120
+
returnErr(anyhow::anyhow!(format!(
121
+
"No structured tool output or text found in response, and permissive JSON5 parsing also failed: {e}; {e2}"
122
+
)));
123
+
}
120
124
}
121
125
}
122
126
}
123
127
}
124
128
_ => {
125
129
returnErr(anyhow::anyhow!(
126
130
"No structured tool output or text found in response"
0 commit comments