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
// Or could we dynamically fill this in for the user based on what labels they have? This is interesting...
5501
5501
runReply:= openai.Run{}
5502
5502
iflen(input.RunId) ==0 {
5503
-
5504
-
//instructions := "Figure out what they want to do based on their input using the available functions. If they ask what you can do, list out the available functions only. Always output valid Markdown. If the status code is not less than 300, make it clear that there was a bug and the user needs to modify it. If you can't find a matching function, use the discover_intent() function and ask if it's ok to run it to find their intent. If you see a workflow ID and execution ID, add a link at the bottom in following format: https://shuffler.io/workflows/{workflow_id}?execution_id={execution_id}"
5505
-
//instructions := fmt.Sprintf("If they ask what you can do, list out the available functions only. Always output valid Markdown. If the status code is not less than 300, make it clear that there was a bug and the user needs to modify the workflow. Output simple answers that are to the point with minimal text. If you see a workflow ID and execution ID, add a link at the bottom in following format: https://shuffler.io/workflows/{workflow_id}?execution_id={execution_id}, and don't mention anything about it otherwise. My username is %s and my organization is %s. Any function can get the parameter 'dryrun' even though it is not specified. Dryrun is used if they don't explicitly say to run the workflow.", user.Username, user.ActiveOrg.Name)
5506
-
5507
5503
// No dryrun
5508
5504
instructions:=fmt.Sprintf("If they ask what you can do, list out the available functions only. Always output valid Markdown. If the status code is not less than 300, make it clear that there was a bug and the user needs to modify the workflow. Output simple answers that are to the point with minimal text. If you see a workflow ID and execution ID, add a link at the bottom in following format: https://shuffler.io/workflows/{workflow_id}?execution_id={execution_id}, and don't mention anything about it otherwise. My username is %s and my organization is %s", user.Username, user.ActiveOrg.Name)
You are a general AI agent which makes decisions based on user input. You should output a list of decisions based on the same input. Available actions within categories you can choose from are below. Only use built-in actions such as analyze (ai analysis) or ask (human analysis) if it is absolutely necessary. Do NOT ask about networking or authentication unless explicitly specified.
6575
+
You are a general AI agent which makes decisions based on user input. You should output a list of decisions based on the same input. Available actions within categories you can choose from are below. Only use the built-in actions 'answer' (ai analysis) or 'ask' (human analysis) if it fits 100%. These are a last resort. Do NOT ask about networking or authentication unless explicitly specified.
extraString:="Return a MINIMUM of one decision in a JSON array. "
6648
6644
iflen(typeOptions) ==0 {
6649
6645
extraString=""
@@ -6730,16 +6726,19 @@ AVAILABLE ACTIONS:
6730
6726
lastFinishedIndex+=1
6731
6727
6732
6728
systemMessage+=fmt.Sprintf(`
6733
-
END AVAILABLE ACTIONS
6729
+
END SINGUL ACTIONS
6734
6730
---
6735
-
SECONDARY ACTIONS:
6731
+
STANDALONE ACTIONS:
6736
6732
1. ask
6733
+
2. answer
6737
6734
6738
-
END SECONDARY ACTIONSACTIONS
6735
+
These actions have the category 'standalone' and should only be used if absolutely necessary. Always prefer using the available actions.
6736
+
6737
+
END STANDALONE ACTIONS
6739
6738
---
6740
6739
DECISION FORMATTING
6741
6740
6742
-
Available categories (default: singul): %s. If you are unsure about a decision, always ask for user input. The output should be an ordered JSON list in the format [{"i": 0, "category": "singul", "action": "action_name", "tool": "<tool name>", "confidence": 0.95, "runs": "1", "reason": "Short reason why", "fields": [{"key": "max_results", "value": "5"}, {"key": "body", "value": "$action_name"}] WITHOUT newlines. The reason should be concise and understandable to a user, and should not include unnecessary details.
6741
+
Available categories: %s. If you are unsure about a decision, always ask for user input. The output should be an ordered JSON list in the format [{"i": 0, "category": "singul", "action": "action_name", "tool": "<tool name>", "confidence": 0.95, "runs": "1", "reason": "Short reason why", "fields": [{"key": "output", "value": "$action_name"}] WITHOUT newlines. The reason should be concise and understandable to a user, and should not include unnecessary details.
6743
6742
6744
6743
END DECISION FORMATTING
6745
6744
---
@@ -6753,13 +6752,14 @@ RULES:
6753
6752
1. General Behavior
6754
6753
6755
6754
* Always perform the specified action; do not just provide an answer.
6755
+
* Fields is an array based on key: value pairs. Don't add unnecessary fields. If using 'ask', the key is 'question' and the value is the question to ask. If using 'answer', the key is 'output' and the value is what to answer.
6756
6756
* NEVER skip executing an action, even if some details are unclear. Fill missing fields only with safe defaults, but still execute.
6757
6757
* NEVER ask the user for clarification, confirmations, or extra details unless it is absolutely unavoidable.
6758
6758
* Focus entirely on performing tasks; gathering input is secondary.
6759
6759
6760
6760
2. Action & Decision Rules
6761
6761
6762
-
* If confidence in an action > 0.5, execute it immediately.
6762
+
* If confidence in an action > 0.7, execute it immediately.
6763
6763
* Always execute API actions: fill required fields (tool, url, method, body) before performing.
6764
6764
* NEVER ask for usernames, API keys, passwords, or authentication information.
6765
6765
* NEVER ask for confirmation before performing an action.
@@ -7271,6 +7271,7 @@ FINALISING:
7271
7271
log.Printf("[ERROR][%s] Failed generating random string for decision index %s-%d", execution.ExecutionId, decision.Tool, decision.I)
log.Printf("\n\n\n\n\n[ERROR] Action '%s' with category '%s' is NOT supported in AI Agent decisions. Skipping...\n\n\n\n\n", decision.Action, decision.Category)
//log.Printf("[DEBUG] HANDLE AGENT DECISION RESULT '%s' -> '%s'!", actionResult.Status, decisionId)
15914
15918
if len(decisionId) == 0 {
15915
-
log.Printf("[ERROR][%s] No decision ID found for node %s. This means we can't map the decision result in any way. Should we set the agent to FAILURE?", actionResult.ExecutionId, actionResult.Action.ID)
15919
+
log.Printf("[ERROR][%s] No decision ID found for node %s. This means we can't map the decision result in any way. Should we set the agent to FAILURE? RAW Status: %#v", actionResult.ExecutionId, actionResult.Action.ID, actionResult.Status)
log.Printf("[DEBUG][%s] Got decision ID '%s' for action result '%s'. Status: %s", workflowExecution.ExecutionId, decisionId, actionResult.Action.ID, actionResult.Status)
15925
+
log.Printf("[DEBUG][%s] Got decision ID '%s' for agent '%s'. Ref: %s", workflowExecution.ExecutionId, decisionId, actionResult.Action.ID, actionResult.Status)
log.Printf("[DEBUG][%s] Updating decision ID '%s' with new status '%s' (old: '%s')", workflowExecution.ExecutionId, decisionId, newDecision.RunDetails.Status, mappedResult.Decisions[decisionIdResultIndex].RunDetails.Status)
0 commit comments