Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae96a7e031
|
@@ -33,11 +33,7 @@ source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
# Command substitution strips *all* trailing newlines and `jq -r` appends one
|
||||
# of its own, so read with `-j` and pin the real end of the content with a
|
||||
# sentinel that is removed afterwards.
|
||||
argc_contents="$(jq -j '.content' <<< "$LLM_TOOL_RAW_JSON"; printf x)"
|
||||
argc_contents="${argc_contents%x}"
|
||||
argc_contents="$(jq -r '.content' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
if [[ ! -f "$argc_path" ]]; then
|
||||
@@ -45,11 +41,7 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Same sentinel guard on the patched result, otherwise the trailing newline
|
||||
# is stripped again on the way back out. `rc` preserves patch_file's exit
|
||||
# status so a failure still aborts under `set -e`.
|
||||
new_contents="$(patch_file "$argc_path" <(printf "%s" "$argc_contents"); rc=$?; printf x; exit "$rc")"
|
||||
new_contents="${new_contents%x}"
|
||||
new_contents="$(patch_file "$argc_path" <(printf "%s" "$argc_contents"))"
|
||||
printf "%s" "$new_contents" | git diff --no-index "$argc_path" - || true
|
||||
|
||||
guard_operation "Apply changes?"
|
||||
|
||||
@@ -15,12 +15,7 @@ source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
# Command substitution strips *all* trailing newlines and `jq -r` appends one
|
||||
# of its own, so read with `-j` and pin the real end of the content with a
|
||||
# sentinel that is removed afterwards. Without this every written file loses
|
||||
# its final newline, which breaks formatters such as `cargo fmt --check`.
|
||||
argc_contents="$(jq -j '.content' <<< "$LLM_TOOL_RAW_JSON"; printf x)"
|
||||
argc_contents="${argc_contents%x}"
|
||||
argc_contents="$(jq -r '.content' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
if [[ -f "$argc_path" ]]; then
|
||||
|
||||
@@ -841,11 +841,6 @@
|
||||
referrer: coyote
|
||||
echo_pkce_in_token_exchange: true
|
||||
models:
|
||||
- name: grok-4.6
|
||||
input_price: 2
|
||||
output_price: 6
|
||||
max_input_tokens: 500000
|
||||
supports_function_calling: true
|
||||
- name: grok-4.5
|
||||
input_price: 2
|
||||
output_price: 6
|
||||
|
||||
+1
-4
@@ -765,10 +765,7 @@ mod tests {
|
||||
assert_eq!(cli.mcp_add, Some("notion".to_string()));
|
||||
assert!(matches!(cli.transport, Some(McpTransportArg::Http)));
|
||||
assert_eq!(cli.url, Some("https://mcp.notion.com/mcp".to_string()));
|
||||
assert_eq!(
|
||||
cli.header,
|
||||
vec!["Authorization: Bearer {{NOTION_TOKEN}}"]
|
||||
);
|
||||
assert_eq!(cli.header, vec!["Authorization: Bearer {{NOTION_TOKEN}}"]);
|
||||
assert!(cli.mcp_command.is_empty());
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -3044,7 +3044,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn reciprocal_rank_fusion_empty_lists() {
|
||||
let result = reciprocal_rank_fusion(vec![], vec![], 5);
|
||||
let result = super::reciprocal_rank_fusion(vec![], vec![], 5);
|
||||
assert!(result.is_empty(), "empty input should produce empty output");
|
||||
}
|
||||
|
||||
@@ -3052,7 +3052,7 @@ mod tests {
|
||||
fn reciprocal_rank_fusion_deduplicates_across_signals() {
|
||||
let doc_a = DocumentId::new(0, 0);
|
||||
let doc_b = DocumentId::new(0, 1);
|
||||
let result = reciprocal_rank_fusion(
|
||||
let result = super::reciprocal_rank_fusion(
|
||||
vec![vec![doc_a, doc_b], vec![doc_a, doc_b]],
|
||||
vec![1.0, 1.0],
|
||||
5,
|
||||
@@ -3069,7 +3069,7 @@ mod tests {
|
||||
#[test]
|
||||
fn reciprocal_rank_fusion_respects_top_k() {
|
||||
let docs: Vec<DocumentId> = (0..10).map(|i| DocumentId::new(0, i)).collect();
|
||||
let result = reciprocal_rank_fusion(vec![docs], vec![1.0], 3);
|
||||
let result = super::reciprocal_rank_fusion(vec![docs], vec![1.0], 3);
|
||||
assert_eq!(result.len(), 3, "result should be capped at top_k=3");
|
||||
}
|
||||
|
||||
@@ -3077,7 +3077,7 @@ mod tests {
|
||||
fn reciprocal_rank_fusion_weights_affect_ranking() {
|
||||
let doc_a = DocumentId::new(0, 0);
|
||||
let doc_b = DocumentId::new(0, 1);
|
||||
let result = reciprocal_rank_fusion(
|
||||
let result = super::reciprocal_rank_fusion(
|
||||
vec![vec![doc_a, doc_b], vec![doc_b, doc_a]],
|
||||
vec![10.0, 1.0],
|
||||
2,
|
||||
|
||||
Reference in New Issue
Block a user