Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae96a7e031
|
@@ -33,11 +33,7 @@ source "$LLM_PROMPT_UTILS_FILE"
|
|||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
main() {
|
main() {
|
||||||
# Command substitution strips *all* trailing newlines and `jq -r` appends one
|
argc_contents="$(jq -r '.content' <<< "$LLM_TOOL_RAW_JSON")"
|
||||||
# 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_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||||
|
|
||||||
if [[ ! -f "$argc_path" ]]; then
|
if [[ ! -f "$argc_path" ]]; then
|
||||||
@@ -45,11 +41,7 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Same sentinel guard on the patched result, otherwise the trailing newline
|
new_contents="$(patch_file "$argc_path" <(printf "%s" "$argc_contents"))"
|
||||||
# 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}"
|
|
||||||
printf "%s" "$new_contents" | git diff --no-index "$argc_path" - || true
|
printf "%s" "$new_contents" | git diff --no-index "$argc_path" - || true
|
||||||
|
|
||||||
guard_operation "Apply changes?"
|
guard_operation "Apply changes?"
|
||||||
|
|||||||
@@ -15,12 +15,7 @@ source "$LLM_PROMPT_UTILS_FILE"
|
|||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
main() {
|
main() {
|
||||||
# Command substitution strips *all* trailing newlines and `jq -r` appends one
|
argc_contents="$(jq -r '.content' <<< "$LLM_TOOL_RAW_JSON")"
|
||||||
# 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_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||||
|
|
||||||
if [[ -f "$argc_path" ]]; then
|
if [[ -f "$argc_path" ]]; then
|
||||||
|
|||||||
@@ -841,11 +841,6 @@
|
|||||||
referrer: coyote
|
referrer: coyote
|
||||||
echo_pkce_in_token_exchange: true
|
echo_pkce_in_token_exchange: true
|
||||||
models:
|
models:
|
||||||
- name: grok-4.6
|
|
||||||
input_price: 2
|
|
||||||
output_price: 6
|
|
||||||
max_input_tokens: 500000
|
|
||||||
supports_function_calling: true
|
|
||||||
- name: grok-4.5
|
- name: grok-4.5
|
||||||
input_price: 2
|
input_price: 2
|
||||||
output_price: 6
|
output_price: 6
|
||||||
|
|||||||
+1
-4
@@ -765,10 +765,7 @@ mod tests {
|
|||||||
assert_eq!(cli.mcp_add, Some("notion".to_string()));
|
assert_eq!(cli.mcp_add, Some("notion".to_string()));
|
||||||
assert!(matches!(cli.transport, Some(McpTransportArg::Http)));
|
assert!(matches!(cli.transport, Some(McpTransportArg::Http)));
|
||||||
assert_eq!(cli.url, Some("https://mcp.notion.com/mcp".to_string()));
|
assert_eq!(cli.url, Some("https://mcp.notion.com/mcp".to_string()));
|
||||||
assert_eq!(
|
assert_eq!(cli.header, vec!["Authorization: Bearer {{NOTION_TOKEN}}"]);
|
||||||
cli.header,
|
|
||||||
vec!["Authorization: Bearer {{NOTION_TOKEN}}"]
|
|
||||||
);
|
|
||||||
assert!(cli.mcp_command.is_empty());
|
assert!(cli.mcp_command.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -3044,7 +3044,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn reciprocal_rank_fusion_empty_lists() {
|
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");
|
assert!(result.is_empty(), "empty input should produce empty output");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3052,7 +3052,7 @@ mod tests {
|
|||||||
fn reciprocal_rank_fusion_deduplicates_across_signals() {
|
fn reciprocal_rank_fusion_deduplicates_across_signals() {
|
||||||
let doc_a = DocumentId::new(0, 0);
|
let doc_a = DocumentId::new(0, 0);
|
||||||
let doc_b = DocumentId::new(0, 1);
|
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![vec![doc_a, doc_b], vec![doc_a, doc_b]],
|
||||||
vec![1.0, 1.0],
|
vec![1.0, 1.0],
|
||||||
5,
|
5,
|
||||||
@@ -3069,7 +3069,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn reciprocal_rank_fusion_respects_top_k() {
|
fn reciprocal_rank_fusion_respects_top_k() {
|
||||||
let docs: Vec<DocumentId> = (0..10).map(|i| DocumentId::new(0, i)).collect();
|
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");
|
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() {
|
fn reciprocal_rank_fusion_weights_affect_ranking() {
|
||||||
let doc_a = DocumentId::new(0, 0);
|
let doc_a = DocumentId::new(0, 0);
|
||||||
let doc_b = DocumentId::new(0, 1);
|
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![vec![doc_a, doc_b], vec![doc_b, doc_a]],
|
||||||
vec![10.0, 1.0],
|
vec![10.0, 1.0],
|
||||||
2,
|
2,
|
||||||
|
|||||||
Reference in New Issue
Block a user