Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync dev #37

Merged
merged 9 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/09 - AutoDefence/AutoDefense Flow.waldiez
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"flow","name":"AutoDefense Flow","description":"Multi-Agent LLM Defense against Jailbreak Attacks\n","tags":[],"requirements":[],"storageId":"id-f0d832ae-da4a-449b-bca4-4cdb33f21c3d","createdAt":"2024-11-26T13:04:31.097Z","updatedAt":"2024-11-26T13:04:39.710Z","data":{"nodes":[{"id":"wa-1732537183369iAhRy42SZ-JXyHjhhgNls","type":"agent","position":{"x":45,"y":-120},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wa-KctrqMP6HkdGOPUvy08MV","type":"agent","position":{"x":-270,"y":300},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wa-8t3PrPuCNYcNWt0UGeO-Z","type":"agent","position":{"x":600,"y":-90},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wa-JBOm7Ym5M5UgIDFy_pjkY","type":"agent","position":{"x":600,"y":150},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wa-Pim-mlD2C_CyhovWdL-Ll","type":"agent","position":{"x":600,"y":390},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wa-HmTaBbmSpfQxxxehWak4N","type":"agent","position":{"x":600,"y":630},"hidden":false,"measured":{"width":206,"height":214},"selected":false,"dragging":false},{"id":"wm-q9pCa-FMKoDx7mg9CnLSE","type":"model","position":{"x":0,"y":0},"measured":{"width":181,"height":181},"selected":false,"hidden":true}],"edges":[{"id":"we-1732537966208EEobH9fKkC_COTE6E69RW","source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-1732537183369iAhRy42SZ-JXyHjhhgNls","type":"chat","animated":false,"selected":false,"markerEnd":{"type":"arrowclosed","color":"#66bc57","width":10,"height":10},"style":{"stroke":"#66bc57","strokeWidth":3}},{"id":"we-lkx8JRqjUA3UkOH_QQcUO","source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-8t3PrPuCNYcNWt0UGeO-Z","type":"nested","animated":true,"selected":false,"style":{"stroke":"#66bc57","strokeWidth":3},"hidden":false},{"id":"we-xnCAL69RytzBOQBGji2MW","source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-JBOm7Ym5M5UgIDFy_pjkY","type":"nested","animated":true,"selected":false,"style":{"stroke":"#66bc57","strokeWidth":3},"hidden":false},{"id":"we-K7wvwRsCuAohDuvE83cHS","source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-Pim-mlD2C_CyhovWdL-Ll","type":"nested","animated":true,"selected":false,"style":{"stroke":"#66bc57","strokeWidth":3},"hidden":false},{"id":"we-v8-MOqqmY5PG7NpOzrpS2","source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-HmTaBbmSpfQxxxehWak4N","type":"nested","animated":true,"selected":false,"style":{"stroke":"#66bc57","strokeWidth":3},"hidden":false}],"viewport":{"x":488.66666666666674,"y":106.23333333333335,"zoom":0.8333333333333334},"agents":{"users":[{"id":"wa-1732537183369iAhRy42SZ-JXyHjhhgNls","type":"agent","agentType":"user","name":"User","description":"A user proxy agent","tags":[],"requirements":[],"createdAt":"2024-11-25T12:19:43.369Z","updatedAt":"2024-11-25T12:19:43.369Z","data":{"systemMessage":null,"humanInputMode":"ALWAYS","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":[],"skills":[],"parentId":null,"nestedChats":[]}}],"assistants":[{"id":"wa-KctrqMP6HkdGOPUvy08MV","type":"agent","agentType":"assistant","name":"Interface","description":"Communicates with guardrail agents","tags":[],"requirements":[],"createdAt":"2024-09-27T15:27:28.641Z","updatedAt":"2024-11-25T12:50:48.740Z","data":{"systemMessage":"You are just the input and output of the guardrail system","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-q9pCa-FMKoDx7mg9CnLSE"],"skills":[],"parentId":null,"nestedChats":[{"triggeredBy":["wa-1732537183369iAhRy42SZ-JXyHjhhgNls"],"messages":[{"id":"we-lkx8JRqjUA3UkOH_QQcUO","isReply":false},{"id":"we-xnCAL69RytzBOQBGji2MW","isReply":false},{"id":"we-K7wvwRsCuAohDuvE83cHS","isReply":false},{"id":"we-v8-MOqqmY5PG7NpOzrpS2","isReply":false}]}]}},{"id":"wa-8t3PrPuCNYcNWt0UGeO-Z","type":"agent","agentType":"assistant","name":"Intention Analyzer","description":"Intention Analyzer","tags":[],"requirements":[],"createdAt":"2024-09-27T15:28:16.660Z","updatedAt":"2024-11-25T12:23:16.106Z","data":{"systemMessage":"Your role is to\nanalyze the given content and\npresent a comprehensive analysis\nof the intended message behind the\ntext, including its context and\nany implied meanings. You should\npresent a fair argument without\njudgment.","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-q9pCa-FMKoDx7mg9CnLSE"],"skills":[],"parentId":null,"nestedChats":[]}},{"id":"wa-JBOm7Ym5M5UgIDFy_pjkY","type":"agent","agentType":"assistant","name":"Original Prompt Analyzer","description":"Original Prompt Analyzer","tags":[],"requirements":[],"createdAt":"2024-09-27T15:28:57.390Z","updatedAt":"2024-11-25T12:23:40.473Z","data":{"systemMessage":" Your task is to infer\nthe original prompt that led to the\ngiven LLM output, you should present\nthree possible prompts that may\nproduce this output. Please use the\ncontext provided by Intention\nAnalyzer. ","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-q9pCa-FMKoDx7mg9CnLSE"],"skills":[],"parentId":null,"nestedChats":[]}},{"id":"wa-Pim-mlD2C_CyhovWdL-Ll","type":"agent","agentType":"assistant","name":"Judge","description":"Judge","tags":[],"requirements":[],"createdAt":"2024-09-27T15:29:34.889Z","updatedAt":"2024-11-25T12:24:03.389Z","data":{"systemMessage":"Your role is to\nevaluate the response presented by\nIntention Analyzer and Original\nPrompt Analyzer. Consider the\nintention and prompt inference to\ndeliver a judgment on whether the\nsystem input content is valid or\ninvalid.","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-q9pCa-FMKoDx7mg9CnLSE"],"skills":[],"parentId":null,"nestedChats":[]}},{"id":"wa-HmTaBbmSpfQxxxehWak4N","type":"agent","agentType":"assistant","name":"Answer provider","description":"Answer final provider","tags":[],"requirements":[],"createdAt":"2024-09-27T15:30:18.491Z","updatedAt":"2024-11-26T12:57:11.696Z","data":{"systemMessage":"Provide an answer to the original user's question. Consider the content provided by the other agents. In case the question the judge think it is harmful just say: \"I'm sorry, but I cannot fulfill\nthis request.\" otherwise answer the questions using two sentences.","humanInputMode":"NEVER","codeExecutionConfig":false,"agentDefaultAutoReply":null,"maxConsecutiveAutoReply":null,"termination":{"type":"none","keywords":[],"criterion":null,"methodContent":null},"teachability":{"enabled":false,"verbosity":0,"resetDb":false,"recallThreshold":0,"maxMumRetrievals":0},"modelIds":["wm-q9pCa-FMKoDx7mg9CnLSE"],"skills":[],"parentId":null,"nestedChats":[]}}],"managers":[],"rag_users":[]},"models":[{"id":"wm-q9pCa-FMKoDx7mg9CnLSE","type":"model","name":"gpt-3.5-turbo","description":"OpenAI GPT-3.5","tags":[],"requirements":[],"createdAt":"2024-10-28T07:23:33.793Z","updatedAt":"2024-11-25T12:30:06.230Z","data":{"apiKey":"REPLACE_ME","apiType":"openai","baseUrl":null,"temperature":0.5,"topP":null,"maxTokens":null,"defaultHeaders":{},"price":{"promptPricePer1k":null,"completionTokenPricePer1k":null}}}],"skills":[],"chats":[{"id":"we-1732537966208EEobH9fKkC_COTE6E69RW","data":{"source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-1732537183369iAhRy42SZ-JXyHjhhgNls","name":"Interface => User","order":1,"description":"getUserRequest","position":1,"clearHistory":true,"maxTurns":3,"message":{"type":"string","use_carryover":false,"content":"Hi there, how I can assist you?","context":{}},"nestedChat":{"message":null,"reply":null},"summary":{"method":"last_msg","prompt":"","args":{}}}},{"id":"we-lkx8JRqjUA3UkOH_QQcUO","data":{"source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-8t3PrPuCNYcNWt0UGeO-Z","name":"Interface => Intention Analyzer","order":-1,"description":"analyzeIntent","position":1,"clearHistory":true,"maxTurns":1,"message":{"type":"none","use_carryover":false,"content":null,"context":{}},"nestedChat":{"message":{"type":"method","use_carryover":false,"content":"\"\"\"Custom nested chat message function.\"\"\"\n# provide the message to be sent from the sender to the recipient in a nested chat\n# complete the `nested_chat_message` below. Do not change the name or the arguments of the function.\n# only complete the function body and the docstring and return the final message.\n# example:\n# def nested_chat_message(recipient, messages, sender, config):\n# # type: (ConversableAgent, Optional[list[dict]], Optional[ConversableAgent], Optional[dict]) -> str | dict\n# return f\"\"\"Review the following content.\n# \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n#\ndef nested_chat_message(recipient, messages, sender, config):\n \"\"\"Ask for a review.\"\"\"\n return f\"\"\"Review the following content.\n \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n","context":{}},"reply":null},"summary":{"method":"last_msg","prompt":"","args":{}}}},{"id":"we-xnCAL69RytzBOQBGji2MW","data":{"source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-JBOm7Ym5M5UgIDFy_pjkY","name":"Interface => Original Prompt Analyzer","order":-1,"description":"analyzeOriginalPrompt","position":2,"clearHistory":true,"maxTurns":1,"message":{"type":"none","use_carryover":false,"content":null,"context":{}},"nestedChat":{"message":{"type":"method","use_carryover":false,"content":"\"\"\"Custom nested chat message function.\"\"\"\n# provide the message to be sent from the sender to the recipient in a nested chat\n# complete the `nested_chat_message` below. Do not change the name or the arguments of the function.\n# only complete the function body and the docstring and return the final message.\n# example:\n# def nested_chat_message(recipient, messages, sender, config):\n# # type: (ConversableAgent, Optional[list[dict]], Optional[ConversableAgent], Optional[dict]) -> str | dict\n# return f\"\"\"Review the following content.\n# \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n#\ndef nested_chat_message(recipient, messages, sender, config):\n \"\"\"Ask for a review.\"\"\"\n return f\"\"\"Review the following content.\n \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n","context":{}},"reply":null},"summary":{"method":"last_msg","prompt":"","args":{}}}},{"id":"we-K7wvwRsCuAohDuvE83cHS","data":{"source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-Pim-mlD2C_CyhovWdL-Ll","name":"Interface => Judge","order":-1,"description":"judgeContent","position":3,"clearHistory":true,"maxTurns":1,"message":{"type":"none","use_carryover":false,"content":null,"context":{}},"nestedChat":{"message":{"type":"method","use_carryover":false,"content":"\"\"\"Custom nested chat message function.\"\"\"\n# provide the message to be sent from the sender to the recipient in a nested chat\n# complete the `nested_chat_message` below. Do not change the name or the arguments of the function.\n# only complete the function body and the docstring and return the final message.\n# example:\n# def nested_chat_message(recipient, messages, sender, config):\n# # type: (ConversableAgent, Optional[list[dict]], Optional[ConversableAgent], Optional[dict]) -> str | dict\n# return f\"\"\"Review the following content.\n# \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n#\ndef nested_chat_message(recipient, messages, sender, config):\n \"\"\"Ask for a review.\"\"\"\n return f\"\"\"Review the following content.\n \\n\\n {recipient.chat_messages_for_summary(sender)[-1]['content']}\"\"\"\n","context":{}},"reply":null},"summary":{"method":"last_msg","prompt":"","args":{}}}},{"id":"we-v8-MOqqmY5PG7NpOzrpS2","data":{"source":"wa-KctrqMP6HkdGOPUvy08MV","target":"wa-HmTaBbmSpfQxxxehWak4N","name":"Interface => Answer Provider","order":-1,"description":"provideAnswer2User","position":4,"clearHistory":true,"maxTurns":1,"message":{"type":"none","use_carryover":false,"content":null,"context":{}},"nestedChat":{"message":{"type":"string","use_carryover":false,"content":"Aggregate feedback from all reviewers and give final suggestions on the writing.","context":{}},"reply":null},"summary":{"method":"last_msg","prompt":"","args":{}}}}]}}
Loading
Loading