Skip to content

Commit

Permalink
Refactor code and update configurations (v.0.3.5.5-cleanup)
Browse files Browse the repository at this point in the history
his commit updates various files including Cargo.toml, config.json, and multiple source code files (client.rs, config.rs, lib.rs, and main.rs)  to refactor code and configurations as part of the v.0.3.5.5-cleanup branch.

building clean no warnings or issues.
  • Loading branch information
njfio committed May 8, 2024
1 parent 7d49f97 commit ca13154
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 286 deletions.
3 changes: 2 additions & 1 deletion fluent_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ serde_json = "1.0"
reqwest = { version = "0.11", features = ["json", "blocking", "multipart", "stream"] }
tokio = { version = "1", features = ["full"] }
clap = { version = "3.0", features = ["derive"] }
clap_complete_fig = "3.1"
tokio-console = "0.1" # For debugging async tasks
config = "0.12"
log = "0.4"
env_logger = "0.9"
atty = "0.2.14"
amber = "0.2.0"
base64 = "0.21.7"
base64 = "0.22.1"
infer = "0.8.0"
pulldown-cmark = "0.9.0"
regex = "1.10.4"
Expand Down
31 changes: 30 additions & 1 deletion fluent_cli/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,9 @@
"allowImageUploads": false,
"temperature": 0.9,
"frequencyPenalty": 0.9,
"systemMessage": "You are a helpful assistant",
"openAIToolAgent_0": {
"systemMessage": "You are a helpful assistant"

}
},
"tweaks": {
Expand Down Expand Up @@ -495,6 +496,34 @@
},
"timeout_ms": 500000
},
{
"name": "GroqLLama370bToolAgentRepoCloud",
"engine": "flowise",
"protocol": "https",
"hostname": "flowise.fluentcli.com",
"port": 443,
"chat_id": "19e0c3b5-d5ff-40aa-bf6a-bc6db22a7a58",
"request_path": "/api/v1/prediction/",
"sessionId": "",
"bearer_token": "AMBER_REPO_CLOUD_FLUENT_DEMO_KEY",
"overrideConfig": {
"sessionId": "AMBER_FLUENT_SESSION_ID_01",
"groqApiKey": "AMBER_FLUENT_GROQ_API_KEY_01",
"serpApiKey": "AMBER_FLUENT_SERPAPI_KEY_01",
"chainName": "groqChain",
"systemMessagePrompt": "You are a helpful assistant",
"temperature": 0.8,
"openAIApiKey": {
"openAIEmbeddings_0": "AMBER_FLUENT_OPENAI_API_KEY_01"
},
"modelName":"llama3-70b-8192",
"memoryKey": "AMBER_FLUENT_SESSION_ID_01"
},
"tweaks": {

},
"timeout_ms": 500000
},
{
"name": "GroqGemma7bAgentRepoCloud",
"engine": "flowise",
Expand Down
44 changes: 22 additions & 22 deletions fluent_cli/functional_tests/functional_test_02.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,52 +76,52 @@ for FLOWNAME in "${FLOWNAMES[@]}"; do
echo ""

run_test "$FLOWNAME" "Base Command Test" \
"$CLI_PATH $FLOWNAME 'This is a test, respond that this is a test'" \
"$CLI_PATH $FLOWNAME 'This is a test, reply this is a test'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is about this is a test'"

run_test "$FLOWNAME" "Stdin Context Test" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what the context'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has the word northstar or North Star'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize this'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request references the word northstar or North Star'"

run_test "$FLOWNAME" "Additional Context File Test" \
"$CLI_PATH $FLOWNAME 'Repeat the outline ' --additional-context-file \"$OUTLINE_FILE\"" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains the word TheLardCatFellFlatOnTheMat'"
"$CLI_PATH $FLOWNAME 'This is a test, Summarize what I provide ' --additional-context-file \"$OUTLINE_FILE\"" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request references the word TheLardCatFellFlatOnTheMat'"

run_test "$FLOWNAME" "Combined Stdin and Additional Context Test" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what I provide for context, and for the outline'' --additional-context-file \"$OUTLINE_FILE\"" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains TheLardCatFellFlatOnTheMat and talks about the word northstar or North Star'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize what I provide: ' --additional-context-file \"$OUTLINE_FILE\"" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the response contains TheLardCatFellFlatOnTheMat and references the word northstar or North Star'"

run_test "$FLOWNAME" "Base Command Test and --system-prompt-override-inline" \
"$CLI_PATH $FLOWNAME 'This is a test, respond that this is a test' --system-prompt-override-inline 'You can only reply in German'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is about this is a test and is in German'"
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if request is in German'"

run_test "$FLOWNAME" "Stdin Context Test and --system-prompt-override-inline" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what I provide for context' --system-prompt-override-inline 'You can only reply in German' " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has the word northstar or North Star and is in German'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize what what I provide in the request:' --system-prompt-override-inline 'You can only reply in German' " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is partly in German'"

run_test "$FLOWNAME" "Additional Context File Test and --system-prompt-override-inline" \
"$CLI_PATH $FLOWNAME 'Repeat what I provide for context, and for the outline' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-inline 'You can only reply in German' " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains the word TheLardCatFellFlatOnTheMat and is in German'"
"$CLI_PATH $FLOWNAME 'This is a test, Summarize what I provided in the request' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-inline 'You can only reply in German' " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is partly in German'"

run_test "$FLOWNAME" "Combined Stdin and Additional Context Test and --system-prompt-override-inline" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what I provide for context, and for the outline' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-inline 'You can only reply in German'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains TheLardCatFellFlatOnTheMat and talks about the word northstar or North Star and is in German'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize what what I provide in the request' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-inline 'You can only reply in German'" \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is partly in German'"

run_test "$FLOWNAME" "Base Command Test and --system-prompt-override-file" \
"$CLI_PATH $FLOWNAME 'This is a test, respond that this is a test' --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request is about this is a test and is in Spanish'"
"$CLI_PATH $FLOWNAME 'This is a test, Summarize that this is a test' --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has spanish words'"

run_test "$FLOWNAME" "Stdin Context Test and --system-prompt-override-file" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what I provide for context:' --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has the word northstar or North Star and is in Spanish'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize what with what I provide in the request ' --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has Spanish words'"

run_test "$FLOWNAME" "Additional Context File Test and --system-prompt-override-file" \
"$CLI_PATH $FLOWNAME 'Repeat what I provide for context, and for the outline' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains the word TheLardCatFellFlatOnTheMat and is in Spanish'"
"$CLI_PATH $FLOWNAME 'This is a test, Summarize what I provide in the request' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has Spanish words'"

run_test "$FLOWNAME" "Combined Stdin and Additional Context Test and --system-prompt-override-file" \
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'Repeat what I provide for context, and for the outline' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request contains TheLardCatFellFlatOnTheMat and talks about the word northstar or North Star and is in Spanish'"
"cat \"$CONTEXT_FILE\" | $CLI_PATH $FLOWNAME 'This is a test, Summarize what I provide in the request:' --additional-context-file \"$OUTLINE_FILE\" --system-prompt-override-file \"$SYSTEM_PROMPT_FILE\" " \
"$VALIDATION_CLI $VALIDATION_FLOWNAME 'Answer PASS or FAIL only if the request has Spanish words'"

done

Expand Down
Loading

0 comments on commit ca13154

Please sign in to comment.