Skip to content

Commit

Permalink
examples updated
Browse files Browse the repository at this point in the history
  • Loading branch information
andthattoo committed Nov 16, 2024
1 parent 193137b commit 75ead48
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions docs/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Here's an example of a task in the `tasks` field. This task generates a web quer
"id": "A",
"name": "Web Search Query",
"description": "Write a web search query to collect useful information for the given question",
"prompt": "Write down a single search query to collect useful information to answer to given question. Be creative. Avoid asking previously asked questions, keep it concise and clear. \n###Query: {query} \n\n ###Previous Questions: {history} \n\n ###Search Query:",
"messages": [{"role": "user", "content":"Write down a single search query to collect useful information to answer to given question. Be creative. Avoid asking previously asked questions, keep it concise and clear. \n###Query: {query} \n\n ###Previous Questions: {history} \n\n ###Search Query:"}],
"inputs": [
{
"name": "query",
Expand Down Expand Up @@ -202,7 +202,7 @@ Here's an example of a simple workflow JSON:
"id": "A",
"name": "Random Poem",
"description": "Writes a poem about Cappadocia.",
"prompt": "Please write a poem about Cappadocia.",
"messages": [{"role": "user", "content":"Please write a poem about Cappadocia."}],
"inputs":[],
"operator": "generation",
"outputs":[]
Expand All @@ -211,7 +211,7 @@ Here's an example of a simple workflow JSON:
"id": "__end",
"name": "end",
"description": "End of the task",
"prompt": "",
"messages": [{"role": "user", "content":""}],
"inputs": [],
"operator": "end",
"outputs": []
Expand Down Expand Up @@ -262,7 +262,7 @@ Memory operations are divided by I/O
Input operations help fill variables in prompts using memory operations.

```json
"prompt": "Write down a single search query to collect useful information to answer to given question. Be creative. Avoid asking previously asked questions, keep it concise and clear. \n\nQuery: {query} \n\n Previous Questions: {history} \n\n Search Query:",
"messages": [{"role": "user", "content":"Write down a single search query to collect useful information to answer to given question. Be creative. Avoid asking previously asked questions, keep it concise and clear. \n\nQuery: {query} \n\n Previous Questions: {history} \n\n Search Query:"}],
"inputs": [
{
"name": "query",
Expand Down
4 changes: 2 additions & 2 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ mod function_call_tests {
"What is the most famous street in Istanbul?"
);
workflow_test!(
function_calling_openai,
openai_function_calling,
Model::GPT4o,
SEARCH_WORKFLOW_PATH,
"How many Hoodoo's are in Kapadokya?"
);
workflow_test!(
function_calling_llama3_1,
llama3_1_function_calling,
Model::Llama3_1_8B,
SEARCH_WORKFLOW_PATH,
"How many fairy chimneys are there in Cappadocia?"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"id": "A",
"name": "Random Poem",
"description": "Completes text",
"prompt": "So who am I to",
"messages": [{"role": "user", "content":"So who am I to"}],
"inputs":[],
"operator": "generation",
"outputs":[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/coding.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"id": "fibonacci",
"name": "Task",
"description": "Task Description",
"prompt": "Write fibonnaci sequence method with memoization in rust",
"messages": [{"role": "user", "content":"Write fibonnaci sequence method with memoization in rust"}],
"inputs": [],
"operator": "generation",
"outputs": [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/context_size.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"id":"A",
"name":"Question generation",
"description":"",
"prompt":"You will be provided with a detailed backstory, a context and a history of previously asked questions. \\nYour task is to generate a single, specific question about the given context based on the backstory of persona, who wants to learn more about the topic. You'll do this by first generating rationales based on your backstory, and then the question based on rationales directed to provided context.\\n\\nYour backstory:\\n<backstory>\\n{{backstory}}\\n</backstory>\\n\\nHere is the context:\\n<context>\\n{{context}}\\n</context>\\n\\nGuidelines for generating the question:\\n1. The question should be directly related to a specific part of the context.\\n2. Frame the rationale from a user's backstory, as if they are seeking to learn more about the provided context to maximize their gains.\\n3. Do not reveal ANY information about the backstory in your question.\\n4. Ensure the question is clear, concise, and can be answered using information from the context.\\n5. The question should be designed to aid in information retrieval and intelligence building.\\n6. Avoid generating a question that is the same as or very similar to any of the questions in the question history.\\n7. Avoid asking multiple questions in one.\\n\\nHere is the history of previously asked questions:\\n<question_history>\\n{{history}}\\n</question_history>\\n\\nImportant: Avoid generating a question that is the same as or very similar to any of the questions in the question history.\\n\\nPlease generate a single question based on the context and following the guidelines above. Provide your generated question within <generated_question> tags. Generate rationales within <rationale> tags.",
"messages": [{"role": "user", "content":"You will be provided with a detailed backstory, a context and a history of previously asked questions. \\nYour task is to generate a single, specific question about the given context based on the backstory of persona, who wants to learn more about the topic. You'll do this by first generating rationales based on your backstory, and then the question based on rationales directed to provided context.\\n\\nYour backstory:\\n<backstory>\\n{{backstory}}\\n</backstory>\\n\\nHere is the context:\\n<context>\\n{{context}}\\n</context>\\n\\nGuidelines for generating the question:\\n1. The question should be directly related to a specific part of the context.\\n2. Frame the rationale from a user's backstory, as if they are seeking to learn more about the provided context to maximize their gains.\\n3. Do not reveal ANY information about the backstory in your question.\\n4. Ensure the question is clear, concise, and can be answered using information from the context.\\n5. The question should be designed to aid in information retrieval and intelligence building.\\n6. Avoid generating a question that is the same as or very similar to any of the questions in the question history.\\n7. Avoid asking multiple questions in one.\\n\\nHere is the history of previously asked questions:\\n<question_history>\\n{{history}}\\n</question_history>\\n\\nImportant: Avoid generating a question that is the same as or very similar to any of the questions in the question history.\\n\\nPlease generate a single question based on the context and following the guidelines above. Provide your generated question within <generated_question> tags. Generate rationales within <rationale> tags."}],
"inputs":[
{
"name":"context",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/custom_tool.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"id": "sum",
"name": "Task",
"description": "Task Description",
"prompt": "What is 10932 + 20934?",
"messages": [{"role": "user", "content":"What is 10932 + 20934?"}],
"inputs": [],
"operator": "function_calling_raw",
"outputs": [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/custom_tools_http.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"id": "get_prices",
"name": "Task",
"description": "Task Description",
"prompt": "What is the current BTC/USDT parity?",
"messages": [{"role": "user", "content":"What is the current BTC/USDT parity?"}],
"inputs": [],
"operator": "function_calling",
"outputs": [
Expand Down
4 changes: 2 additions & 2 deletions tests/test_workflows/insert.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"id": "A",
"name": "Random Facts about Kapadokya",
"description": "Write down facts about Kapadokya. ",
"prompt": "Please write a facts about Kapadokya. Refrain from generating previously generated facts.\n\n ###History:{history}",
"messages": [{"role": "user", "content":"Please write a facts about Kapadokya. Refrain from generating previously generated facts.\n\n ###History:{history}"}],
"inputs":[
{
"name": "history",
Expand Down Expand Up @@ -40,7 +40,7 @@
"id": "B",
"name": "Search",
"description": "Perform search on kapadokya",
"prompt": "What are the unique geographic features of Kapadokya?",
"messages": [{"role": "user", "content":"What are the unique geographic features of Kapadokya?"}],
"inputs":[],
"operator": "search",
"outputs":[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/long_context.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test_workflows/multiple_steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"id": "A",
"name": "Random Poem",
"description": "Writes a poem about Kapadokya.",
"prompt": "Here are the previous lines of the poem: {poem}. Please write the next line. If there are no previous lines, write the first line. Only output your poem sentence",
"messages": [{"role": "user", "content":"Here are the previous lines of the poem: {poem}. Please write the next line. If there are no previous lines, write the first line. Only output your poem sentence"}],
"inputs":[
{
"name": "poem",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/post_process.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"id": "A",
"name": "Random Poem",
"description": "Writes a poem about Kapadokya.",
"prompt": "Please write a poem about Kapadokya.",
"messages": [{"role": "user", "content":"Please write a poem about Kapadokya."}],
"inputs":[],
"operator": "generation",
"outputs":[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"id": "A",
"name": "Web Search Query",
"description": "Write a web search query to collect useful information for the given question",
"prompt": "You are a researcher AI tasked with generating web search queries to aid in the research process on a given topic. Your goal is to formulate questions that will help explore different aspects of the topic and gather comprehensive knowledge.\n\nThe topic you are researching is:\n<topic>\n{{topic}}\n</topic>\n\nThese are your perspectives as a researcher while asking questions:\n<perspectives>\n{{perspectives}}\n</perspectives>\n\nHere is the history of previously asked questions:\n<previous_questions>\n{{previous_questions}}\n</previous_questions>\n\nTo generate a new search query:\n\n1. Analyze the given topic and the history of previous questions.\n2. Identify aspects of the topic that have not been covered or areas that could benefit from deeper exploration.\n3. Consider different perspectives, time periods, or interdisciplinary connections related to the topic.\n4. Formulate a clear, concise, and specific search query that addresses an unexplored or underexplored aspect of the topic.\n5. Ensure your query is distinct from the previous questions and adds value to the research process.\n\nGuidelines for your search query:\n- Keep it between 5-15 words\n- Use specific terms related to the topic\n- Include relevant keywords that will yield informative results\n- Avoid overly broad or vague questions\n- Do not repeat previous questions or ask for information already covered\n\nPresent your final search query within <search_query> tags.\n\nExample output:\n\n<search_query>\n[Your generated search query here]\n</search_query>\n\nNow, based on the given topic and previous questions, generate a new search query following these instructions.",
"messages": [{"role": "user", "content":"You are a researcher AI tasked with generating web search queries to aid in the research process on a given topic. Your goal is to formulate questions that will help explore different aspects of the topic and gather comprehensive knowledge.\n\nThe topic you are researching is:\n<topic>\n{{topic}}\n</topic>\n\nThese are your perspectives as a researcher while asking questions:\n<perspectives>\n{{perspectives}}\n</perspectives>\n\nHere is the history of previously asked questions:\n<previous_questions>\n{{previous_questions}}\n</previous_questions>\n\nTo generate a new search query:\n\n1. Analyze the given topic and the history of previous questions.\n2. Identify aspects of the topic that have not been covered or areas that could benefit from deeper exploration.\n3. Consider different perspectives, time periods, or interdisciplinary connections related to the topic.\n4. Formulate a clear, concise, and specific search query that addresses an unexplored or underexplored aspect of the topic.\n5. Ensure your query is distinct from the previous questions and adds value to the research process.\n\nGuidelines for your search query:\n- Keep it between 5-15 words\n- Use specific terms related to the topic\n- Include relevant keywords that will yield informative results\n- Avoid overly broad or vague questions\n- Do not repeat previous questions or ask for information already covered\n\nPresent your final search query within <search_query> tags.\n\nExample output:\n\n<search_query>\n[Your generated search query here]\n</search_query>\n\nNow, based on the given topic and previous questions, generate a new search query following these instructions."}],
"inputs": [
{
"name": "topic",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflows/ticker.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"id": "A",
"name": "APPL",
"description": "Fetches the current value of $APPL",
"prompt": "What is the current value of $APPL?",
"messages": [{"role": "user", "content":"What is the current value of $APPL?"}],
"inputs":[],
"operator": "function_calling",
"outputs":[
Expand Down
4 changes: 2 additions & 2 deletions tests/test_workflows/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"id": "A",
"name": "PickVar",
"description": "",
"prompt": "{random_var}",
"messages": [{"role": "user", "content":"{random_var}"}],
"inputs":[
{
"name": "random_var",
Expand All @@ -59,7 +59,7 @@
"id": "B",
"name": "Generate Review",
"description": "Validates random variables w.r.t. task at hand",
"prompt": "You are a synthetic user. Write a review for the airline you traveled with. The review should be based on your experience and should be a minimum of 10 words. <persona>{persona}</persona> ###Ouput:",
"messages": [{"role": "user", "content":"You are a synthetic user. Write a review for the airline you traveled with. The review should be based on your experience and should be a minimum of 10 words. <persona>{persona}</persona> ###Ouput:"}],
"inputs":[
{
"name":"persona",
Expand Down

0 comments on commit 75ead48

Please sign in to comment.