From 09508dc8ba6804c9ae968aa9426fa3ab39fe456c Mon Sep 17 00:00:00 2001 From: Evan Mattson <35585003+moonbox3@users.noreply.github.com> Date: Sat, 4 May 2024 07:50:04 -0400 Subject: [PATCH] Python: Restructure samples into new folders to make things more clear. (#6116) ### Motivation and Context All previous samples were either in kernel syntax or a separate notebooks folder. The goal is to make the samples easier to understand and have a better structure. ### Description The PR restructures the kernel syntax examples into new folders: concepts (with subfolders for previous syntax examples), demos, getting_started, and learn_resources. - Closes #6119 - Adds a new concept/function example for understanding kernel arguments. - Updates the bookings plugin ### Contribution Checklist - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone :smile: --- README.md | 2 +- .../AssistantShowCalendarEvents/config.json | 0 .../AssistantShowCalendarEvents/skprompt.txt | 0 .../ChatPlugin/Chat/config.json | 0 .../ChatPlugin/Chat/skprompt.txt | 0 .../ChatPlugin/ChatFilter/config.json | 0 .../ChatPlugin/ChatFilter/skprompt.txt | 0 .../ChatPlugin/ChatGPT/config.json | 0 .../ChatPlugin/ChatGPT/skprompt.txt | 0 .../ChatPlugin/ChatUser/config.json | 0 .../ChatPlugin/ChatUser/skprompt.txt | 0 .../ChatPlugin/ChatV2/config.json | 0 .../ChatPlugin/ChatV2/skprompt.txt | 0 .../ChildrensBookPlugin/BookIdeas/config.json | 0 .../BookIdeas/skprompt.txt | 0 .../CreateBook/config.json | 0 .../CreateBook/skprompt.txt | 0 .../Importance/config.json | 0 .../Importance/skprompt.txt | 0 .../ClassificationPlugin/Question/config.json | 0 .../Question/skprompt.txt | 0 .../CodingPlugin/Code/config.json | 0 .../CodingPlugin/Code/skprompt.txt | 0 .../CodingPlugin/CodePython/config.json | 0 .../CodingPlugin/CodePython/skprompt.txt | 0 .../CommandLinePython/config.json | 0 .../CommandLinePython/skprompt.txt | 0 .../CodingPlugin/DOSScript/config.json | 0 .../CodingPlugin/DOSScript/skprompt.txt | 0 .../CodingPlugin/EmailSearch/config.json | 0 .../CodingPlugin/EmailSearch/skprompt.txt | 0 .../CodingPlugin/Entity/config.json | 0 .../CodingPlugin/Entity/skprompt.txt | 0 .../FunPlugin/Excuses/config.json | 0 .../FunPlugin/Excuses/skprompt.txt | 0 .../FunPlugin/Joke/config.json | 0 .../FunPlugin/Joke/skprompt.txt | 0 .../FunPlugin/Limerick/config.json | 0 .../FunPlugin/Limerick/skprompt.txt | 0 .../ExciseEntities/config.json | 0 .../ExciseEntities/skprompt.txt | 0 .../ExtractEntities/config.json | 0 .../ExtractEntities/skprompt.txt | 0 .../ReferenceCheckEntities/config.json | 0 .../ReferenceCheckEntities/skprompt.txt | 0 .../AssistantIntent/config.json | 0 .../AssistantIntent/skprompt.txt | 0 .../MiscPlugin/Continue/config.json | 0 .../MiscPlugin/Continue/skprompt.txt | 0 .../MiscPlugin/ElementAtIndex/config.json | 0 .../MiscPlugin/ElementAtIndex/skprompt.txt | 0 .../QAPlugin/AssistantResults/config.json | 0 .../QAPlugin/AssistantResults/skprompt.txt | 0 .../QAPlugin/ContextQuery/config.json | 0 .../QAPlugin/ContextQuery/skprompt.txt | 0 .../QAPlugin/Form/config.json | 0 .../QAPlugin/Form/skprompt.txt | 0 .../QAPlugin/GitHubMemoryQuery/config.json | 0 .../QAPlugin/GitHubMemoryQuery/skprompt.txt | 0 .../QAPlugin/QNA/config.json | 0 .../QAPlugin/QNA/skprompt.txt | 0 .../QAPlugin/Question/config.json | 0 .../QAPlugin/Question/skprompt.txt | 0 .../MakeAbstractReadable/config.json | 0 .../MakeAbstractReadable/skprompt.txt | 0 .../SummarizePlugin/Notegen/config.json | 0 .../SummarizePlugin/Notegen/skprompt.txt | 0 .../SummarizePlugin/Summarize/config.json | 0 .../SummarizePlugin/Summarize/skprompt.txt | 0 .../SummarizePlugin/Topics/config.json | 0 .../SummarizePlugin/Topics/skprompt.txt | 0 .../WriterPlugin/Acronym/config.json | 0 .../WriterPlugin/Acronym/skprompt.txt | 0 .../WriterPlugin/AcronymGenerator/config.json | 0 .../AcronymGenerator/skprompt.txt | 0 .../WriterPlugin/AcronymReverse/config.json | 0 .../WriterPlugin/AcronymReverse/skprompt.txt | 0 .../WriterPlugin/Brainstorm/config.json | 0 .../WriterPlugin/Brainstorm/skprompt.txt | 0 .../WriterPlugin/EmailGen/config.json | 0 .../WriterPlugin/EmailGen/skprompt.txt | 0 .../WriterPlugin/EmailTo/config.json | 0 .../WriterPlugin/EmailTo/skprompt.txt | 0 .../WriterPlugin/EnglishImprover/config.json | 0 .../WriterPlugin/EnglishImprover/skprompt.txt | 0 .../WriterPlugin/NovelChapter/config.json | 0 .../WriterPlugin/NovelChapter/skprompt.txt | 0 .../NovelChapterWithNotes/config.json | 0 .../NovelChapterWithNotes/skprompt.txt | 0 .../WriterPlugin/NovelOutline/config.json | 0 .../WriterPlugin/NovelOutline/skprompt.txt | 0 .../WriterPlugin/Rewrite/config.json | 0 .../WriterPlugin/Rewrite/skprompt.txt | 0 .../WriterPlugin/ShortPoem/config.json | 0 .../WriterPlugin/ShortPoem/skprompt.txt | 0 .../WriterPlugin/StoryGen/config.json | 0 .../WriterPlugin/StoryGen/skprompt.txt | 0 .../WriterPlugin/TellMeMore/config.json | 0 .../WriterPlugin/TellMeMore/skprompt.txt | 0 .../WriterPlugin/Translate/config.json | 0 .../WriterPlugin/Translate/skprompt.txt | 0 .../TwoSentenceSummary/config.json | 0 .../TwoSentenceSummary/skprompt.txt | 0 python/DEV_SETUP.md | 8 +- python/README.md | 24 ++-- python/samples/concepts/README.md | 19 +++ .../chat_gpt_api_function_calling.py | 0 .../chat_completion}/azure_chat_gpt_api.py | 0 .../chat_completion}/chat.py | 0 .../chat_completion}/chat_gpt_api.py | 0 .../chat_completion}/openai_logit_bias.py | 0 .../concepts/functions/kernel_arguments.py | 72 ++++++++++ .../grounding}/grounded.py | 0 .../logging}/setup_logging.py | 0 .../memory}/azure_cognitive_search_memory.py | 0 .../memory}/google_palm_chat_with_memory.py | 0 .../memory}/memory.py | 0 .../azure_chat_gpt_with_data_api.py | 0 ...chat_gpt_with_data_api_function_calling.py | 0 ...re_chat_gpt_with_data_api_vector_search.py | 0 .../planners}/action_planner.py | 0 ...penai_function_calling_stepwise_planner.py | 0 ...penai_function_calling_stepwise_planner.py | 0 .../planners}/sequential_planner.py | 0 .../plugins}/google_palm_chat_with_plugin.py | 0 ...nai_function_calling_with_custom_plugin.py | 0 .../plugins}/openai_plugin_azure_key_vault.py | 0 .../plugins}/openai_plugin_klarna.py | 0 .../plugins/openapi}/README.md | 0 .../plugins/openapi}/openapi.yaml | 0 .../plugins/openapi}/openapi_client.py | 0 .../plugins/openapi}/openapi_server.py | 0 .../plugins}/plugins_from_dir.py | 0 .../azure_chat_gpt_api_handlebars.py | 0 .../azure_chat_gpt_api_jinja2.py | 0 .../prompt_templates}/configuring_prompts.py | 0 .../prompt_templates}/load_yaml_prompt.py | 0 .../prompt_templates}/template_language.py | 0 .../rag}/rag_with_text_memory_plugin.py | 0 .../rag}/self-critique_rag.py | 0 .../resources/__init__.py | 0 .../resources/email_plugin/native_function.py | 0 .../resources/open_ai_plugins/akv-openai.json | 0 .../open_ai_plugins/akv-openapi.yaml | 0 .../sample_plugins/generate_story.yaml | 0 .../resources/sample_plugins/parrot.yaml | 0 .../samples/{ => concepts/resources}/utils.py | 0 .../search}/bing_plugin_examples.py | 0 .../search}/bing_search_plugin.py | 0 .../search}/google_search_plugin.py | 0 .../google_palm_text_completion.py | 0 .../demos/booking_restaurant/README.md | 129 ++++++++++++++++++ .../bookings_plugin/__init__.py | 0 .../bookings_plugin/bookings_plugin.py | 39 +++--- .../booking_restaurant}/restaurant_booking.py | 9 +- .../getting_started}/.env.example | 0 .../getting_started}/00-getting-started.ipynb | 0 .../01-basic-loading-the-kernel.ipynb | 0 .../02-running-prompts-from-file.ipynb | 0 .../03-prompt-function-inline.ipynb | 0 .../04-kernel-arguments-chat.ipynb | 0 .../05-using-the-planner.ipynb | 0 .../06-memory-and-embeddings.ipynb | 0 .../07-hugging-face-for-plugins.ipynb | 0 .../08-native-function-inline.ipynb | 0 .../09-groundedness-checking.ipynb | 0 .../10-multiple-results-per-prompt.ipynb | 0 .../11-streaming-completions.ipynb | 0 .../getting_started}/services.py | 0 .../getting_started}/third_party/.env.example | 0 .../weaviate-persistent-memory.ipynb | 0 .../.env.example | 0 .../README.md | 0 .../ai_services.py | 0 .../configuring_prompts.py | 0 .../creating_functions.py | 0 .../evaluate_with_prompt_flow.py | 0 .../functions_within_prompts.py | 0 .../improved_evaluate_with_prompt_flow.py | 0 .../planner.py | 0 .../plugin.py | 0 .../plugins/MathPlugin/native_function.py | 0 .../OrchestratorPlugin/GetIntent/config.json | 0 .../OrchestratorPlugin/GetIntent/skprompt.txt | 0 .../WriterPlugin/ShortPoem/config.json | 0 .../WriterPlugin/ShortPoem/skprompt.txt | 0 .../.promptflow/flow.layout.json | 0 .../perform_math/.gitignore | 0 .../perform_math/.promptflow/flow.tools.json | 0 .../perform_math/data.jsonl | 0 .../perform_math/flow.dag.yaml | 0 .../perform_math/math_planner.py | 0 .../perform_math/plugins/MathPlugin/Math.py | 0 .../plugins/prompts/chat/config.json | 0 .../plugins/prompts/chat/skprompt.txt | 0 .../prompts.py | 0 .../serializing_prompts.py | 0 .../service_configurator.py | 0 .../templates.py | 0 .../using_the_kernel.py | 0 200 files changed, 256 insertions(+), 46 deletions(-) rename {samples/plugins => prompt_template_samples}/CalendarPlugin/AssistantShowCalendarEvents/config.json (100%) rename {samples/plugins => prompt_template_samples}/CalendarPlugin/AssistantShowCalendarEvents/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/Chat/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/Chat/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatFilter/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatFilter/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatGPT/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatGPT/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatUser/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatUser/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatV2/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChatPlugin/ChatV2/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChildrensBookPlugin/BookIdeas/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChildrensBookPlugin/BookIdeas/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ChildrensBookPlugin/CreateBook/config.json (100%) rename {samples/plugins => prompt_template_samples}/ChildrensBookPlugin/CreateBook/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ClassificationPlugin/Importance/config.json (100%) rename {samples/plugins => prompt_template_samples}/ClassificationPlugin/Importance/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/ClassificationPlugin/Question/config.json (100%) rename {samples/plugins => prompt_template_samples}/ClassificationPlugin/Question/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/Code/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/Code/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/CodePython/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/CodePython/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/CommandLinePython/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/CommandLinePython/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/DOSScript/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/DOSScript/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/EmailSearch/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/EmailSearch/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/Entity/config.json (100%) rename {samples/plugins => prompt_template_samples}/CodingPlugin/Entity/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Excuses/config.json (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Excuses/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Joke/config.json (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Joke/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Limerick/config.json (100%) rename {samples/plugins => prompt_template_samples}/FunPlugin/Limerick/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ExciseEntities/config.json (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ExciseEntities/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ExtractEntities/config.json (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ExtractEntities/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ReferenceCheckEntities/config.json (100%) rename {samples/plugins => prompt_template_samples}/GroundingPlugin/ReferenceCheckEntities/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/IntentDetectionPlugin/AssistantIntent/config.json (100%) rename {samples/plugins => prompt_template_samples}/IntentDetectionPlugin/AssistantIntent/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/MiscPlugin/Continue/config.json (100%) rename {samples/plugins => prompt_template_samples}/MiscPlugin/Continue/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/MiscPlugin/ElementAtIndex/config.json (100%) rename {samples/plugins => prompt_template_samples}/MiscPlugin/ElementAtIndex/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/AssistantResults/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/AssistantResults/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/ContextQuery/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/ContextQuery/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/Form/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/Form/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/GitHubMemoryQuery/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/GitHubMemoryQuery/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/QNA/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/QNA/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/Question/config.json (100%) rename {samples/plugins => prompt_template_samples}/QAPlugin/Question/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/MakeAbstractReadable/config.json (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/MakeAbstractReadable/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Notegen/config.json (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Notegen/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Summarize/config.json (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Summarize/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Topics/config.json (100%) rename {samples/plugins => prompt_template_samples}/SummarizePlugin/Topics/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Acronym/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Acronym/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/AcronymGenerator/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/AcronymGenerator/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/AcronymReverse/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/AcronymReverse/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Brainstorm/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Brainstorm/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EmailGen/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EmailGen/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EmailTo/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EmailTo/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EnglishImprover/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/EnglishImprover/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelChapter/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelChapter/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelChapterWithNotes/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelChapterWithNotes/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelOutline/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/NovelOutline/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Rewrite/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Rewrite/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/ShortPoem/config.json (100%) rename {python/samples/documentation_examples/plugins => prompt_template_samples}/WriterPlugin/ShortPoem/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/StoryGen/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/StoryGen/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/TellMeMore/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/TellMeMore/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Translate/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/Translate/skprompt.txt (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/TwoSentenceSummary/config.json (100%) rename {samples/plugins => prompt_template_samples}/WriterPlugin/TwoSentenceSummary/skprompt.txt (100%) create mode 100644 python/samples/concepts/README.md rename python/samples/{kernel-syntax-examples => concepts/auto_function_calling}/chat_gpt_api_function_calling.py (100%) rename python/samples/{kernel-syntax-examples => concepts/chat_completion}/azure_chat_gpt_api.py (100%) rename python/samples/{kernel-syntax-examples => concepts/chat_completion}/chat.py (100%) rename python/samples/{kernel-syntax-examples => concepts/chat_completion}/chat_gpt_api.py (100%) rename python/samples/{kernel-syntax-examples => concepts/chat_completion}/openai_logit_bias.py (100%) create mode 100644 python/samples/concepts/functions/kernel_arguments.py rename python/samples/{kernel-syntax-examples => concepts/grounding}/grounded.py (100%) rename python/samples/{kernel-syntax-examples => concepts/logging}/setup_logging.py (100%) rename python/samples/{kernel-syntax-examples => concepts/memory}/azure_cognitive_search_memory.py (100%) rename python/samples/{kernel-syntax-examples => concepts/memory}/google_palm_chat_with_memory.py (100%) rename python/samples/{kernel-syntax-examples => concepts/memory}/memory.py (100%) rename python/samples/{kernel-syntax-examples => concepts/on_your_data}/azure_chat_gpt_with_data_api.py (100%) rename python/samples/{kernel-syntax-examples => concepts/on_your_data}/azure_chat_gpt_with_data_api_function_calling.py (100%) rename python/samples/{kernel-syntax-examples => concepts/on_your_data}/azure_chat_gpt_with_data_api_vector_search.py (100%) rename python/samples/{kernel-syntax-examples => concepts/planners}/action_planner.py (100%) rename python/samples/{kernel-syntax-examples => concepts/planners}/azure_openai_function_calling_stepwise_planner.py (100%) rename python/samples/{kernel-syntax-examples => concepts/planners}/openai_function_calling_stepwise_planner.py (100%) rename python/samples/{kernel-syntax-examples => concepts/planners}/sequential_planner.py (100%) rename python/samples/{kernel-syntax-examples => concepts/plugins}/google_palm_chat_with_plugin.py (100%) rename python/samples/{kernel-syntax-examples => concepts/plugins}/openai_function_calling_with_custom_plugin.py (100%) rename python/samples/{kernel-syntax-examples => concepts/plugins}/openai_plugin_azure_key_vault.py (100%) rename python/samples/{kernel-syntax-examples => concepts/plugins}/openai_plugin_klarna.py (100%) rename python/samples/{kernel-syntax-examples/openapi_example => concepts/plugins/openapi}/README.md (100%) rename python/samples/{kernel-syntax-examples/openapi_example => concepts/plugins/openapi}/openapi.yaml (100%) rename python/samples/{kernel-syntax-examples/openapi_example => concepts/plugins/openapi}/openapi_client.py (100%) rename python/samples/{kernel-syntax-examples/openapi_example => concepts/plugins/openapi}/openapi_server.py (100%) rename python/samples/{kernel-syntax-examples => concepts/plugins}/plugins_from_dir.py (100%) rename python/samples/{kernel-syntax-examples => concepts/prompt_templates}/azure_chat_gpt_api_handlebars.py (100%) rename python/samples/{kernel-syntax-examples => concepts/prompt_templates}/azure_chat_gpt_api_jinja2.py (100%) rename python/samples/{kernel-syntax-examples => concepts/prompt_templates}/configuring_prompts.py (100%) rename python/samples/{kernel-syntax-examples => concepts/prompt_templates}/load_yaml_prompt.py (100%) rename python/samples/{kernel-syntax-examples => concepts/prompt_templates}/template_language.py (100%) rename python/samples/{kernel-syntax-examples => concepts/rag}/rag_with_text_memory_plugin.py (100%) rename python/samples/{kernel-syntax-examples => concepts/rag}/self-critique_rag.py (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/__init__.py (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/email_plugin/native_function.py (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/open_ai_plugins/akv-openai.json (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/open_ai_plugins/akv-openapi.yaml (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/sample_plugins/generate_story.yaml (100%) rename python/samples/{kernel-syntax-examples => concepts}/resources/sample_plugins/parrot.yaml (100%) rename python/samples/{ => concepts/resources}/utils.py (100%) rename python/samples/{kernel-syntax-examples => concepts/search}/bing_plugin_examples.py (100%) rename python/samples/{kernel-syntax-examples => concepts/search}/bing_search_plugin.py (100%) rename python/samples/{kernel-syntax-examples => concepts/search}/google_search_plugin.py (100%) rename python/samples/{kernel-syntax-examples => concepts/text_generation}/google_palm_text_completion.py (100%) create mode 100644 python/samples/demos/booking_restaurant/README.md rename python/samples/{kernel-syntax-examples/resources => demos/booking_restaurant}/bookings_plugin/__init__.py (100%) rename python/samples/{kernel-syntax-examples/resources => demos/booking_restaurant}/bookings_plugin/bookings_plugin.py (84%) rename python/samples/{kernel-syntax-examples => demos/booking_restaurant}/restaurant_booking.py (88%) rename python/{notebooks => samples/getting_started}/.env.example (100%) rename python/{notebooks => samples/getting_started}/00-getting-started.ipynb (100%) rename python/{notebooks => samples/getting_started}/01-basic-loading-the-kernel.ipynb (100%) rename python/{notebooks => samples/getting_started}/02-running-prompts-from-file.ipynb (100%) rename python/{notebooks => samples/getting_started}/03-prompt-function-inline.ipynb (100%) rename python/{notebooks => samples/getting_started}/04-kernel-arguments-chat.ipynb (100%) rename python/{notebooks => samples/getting_started}/05-using-the-planner.ipynb (100%) rename python/{notebooks => samples/getting_started}/06-memory-and-embeddings.ipynb (100%) rename python/{notebooks => samples/getting_started}/07-hugging-face-for-plugins.ipynb (100%) rename python/{notebooks => samples/getting_started}/08-native-function-inline.ipynb (100%) rename python/{notebooks => samples/getting_started}/09-groundedness-checking.ipynb (100%) rename python/{notebooks => samples/getting_started}/10-multiple-results-per-prompt.ipynb (100%) rename python/{notebooks => samples/getting_started}/11-streaming-completions.ipynb (100%) rename python/{notebooks => samples/getting_started}/services.py (100%) rename python/{notebooks => samples/getting_started}/third_party/.env.example (100%) rename python/{notebooks => samples/getting_started}/third_party/weaviate-persistent-memory.ipynb (100%) rename python/samples/{documentation_examples => learn_resources}/.env.example (100%) rename python/samples/{documentation_examples => learn_resources}/README.md (100%) rename python/samples/{documentation_examples => learn_resources}/ai_services.py (100%) rename python/samples/{documentation_examples => learn_resources}/configuring_prompts.py (100%) rename python/samples/{documentation_examples => learn_resources}/creating_functions.py (100%) rename python/samples/{documentation_examples => learn_resources}/evaluate_with_prompt_flow.py (100%) rename python/samples/{documentation_examples => learn_resources}/functions_within_prompts.py (100%) rename python/samples/{documentation_examples => learn_resources}/improved_evaluate_with_prompt_flow.py (100%) rename python/samples/{documentation_examples => learn_resources}/planner.py (100%) rename python/samples/{documentation_examples => learn_resources}/plugin.py (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/MathPlugin/native_function.py (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/OrchestratorPlugin/GetIntent/config.json (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/OrchestratorPlugin/GetIntent/skprompt.txt (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/WriterPlugin/ShortPoem/config.json (100%) rename {samples => python/samples/learn_resources}/plugins/WriterPlugin/ShortPoem/skprompt.txt (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/.promptflow/flow.layout.json (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/.gitignore (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/.promptflow/flow.tools.json (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/data.jsonl (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/flow.dag.yaml (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/math_planner.py (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompt_flow_helpers/perform_math/plugins/MathPlugin/Math.py (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompts/chat/config.json (100%) rename python/samples/{documentation_examples => learn_resources}/plugins/prompts/chat/skprompt.txt (100%) rename python/samples/{documentation_examples => learn_resources}/prompts.py (100%) rename python/samples/{documentation_examples => learn_resources}/serializing_prompts.py (100%) rename python/samples/{documentation_examples => learn_resources}/service_configurator.py (100%) rename python/samples/{documentation_examples => learn_resources}/templates.py (100%) rename python/samples/{documentation_examples => learn_resources}/using_the_kernel.py (100%) diff --git a/README.md b/README.md index 9a0f0f37413b..5293d7e9a136 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The fastest way to learn how to use Semantic Kernel is with our C# and Python Ju demonstrate how to use Semantic Kernel with code snippets that you can run with a push of a button. - [Getting Started with C# notebook](dotnet/notebooks/00-getting-started.ipynb) -- [Getting Started with Python notebook](python/notebooks/00-getting-started.ipynb) +- [Getting Started with Python notebook](python/samples/getting_started/00-getting-started.ipynb) Once you've finished the getting started notebooks, you can then check out the main walkthroughs on our Learn site. Each sample comes with a completed C# and Python project that you can run locally. diff --git a/samples/plugins/CalendarPlugin/AssistantShowCalendarEvents/config.json b/prompt_template_samples/CalendarPlugin/AssistantShowCalendarEvents/config.json similarity index 100% rename from samples/plugins/CalendarPlugin/AssistantShowCalendarEvents/config.json rename to prompt_template_samples/CalendarPlugin/AssistantShowCalendarEvents/config.json diff --git a/samples/plugins/CalendarPlugin/AssistantShowCalendarEvents/skprompt.txt b/prompt_template_samples/CalendarPlugin/AssistantShowCalendarEvents/skprompt.txt similarity index 100% rename from samples/plugins/CalendarPlugin/AssistantShowCalendarEvents/skprompt.txt rename to prompt_template_samples/CalendarPlugin/AssistantShowCalendarEvents/skprompt.txt diff --git a/samples/plugins/ChatPlugin/Chat/config.json b/prompt_template_samples/ChatPlugin/Chat/config.json similarity index 100% rename from samples/plugins/ChatPlugin/Chat/config.json rename to prompt_template_samples/ChatPlugin/Chat/config.json diff --git a/samples/plugins/ChatPlugin/Chat/skprompt.txt b/prompt_template_samples/ChatPlugin/Chat/skprompt.txt similarity index 100% rename from samples/plugins/ChatPlugin/Chat/skprompt.txt rename to prompt_template_samples/ChatPlugin/Chat/skprompt.txt diff --git a/samples/plugins/ChatPlugin/ChatFilter/config.json b/prompt_template_samples/ChatPlugin/ChatFilter/config.json similarity index 100% rename from samples/plugins/ChatPlugin/ChatFilter/config.json rename to prompt_template_samples/ChatPlugin/ChatFilter/config.json diff --git a/samples/plugins/ChatPlugin/ChatFilter/skprompt.txt b/prompt_template_samples/ChatPlugin/ChatFilter/skprompt.txt similarity index 100% rename from samples/plugins/ChatPlugin/ChatFilter/skprompt.txt rename to prompt_template_samples/ChatPlugin/ChatFilter/skprompt.txt diff --git a/samples/plugins/ChatPlugin/ChatGPT/config.json b/prompt_template_samples/ChatPlugin/ChatGPT/config.json similarity index 100% rename from samples/plugins/ChatPlugin/ChatGPT/config.json rename to prompt_template_samples/ChatPlugin/ChatGPT/config.json diff --git a/samples/plugins/ChatPlugin/ChatGPT/skprompt.txt b/prompt_template_samples/ChatPlugin/ChatGPT/skprompt.txt similarity index 100% rename from samples/plugins/ChatPlugin/ChatGPT/skprompt.txt rename to prompt_template_samples/ChatPlugin/ChatGPT/skprompt.txt diff --git a/samples/plugins/ChatPlugin/ChatUser/config.json b/prompt_template_samples/ChatPlugin/ChatUser/config.json similarity index 100% rename from samples/plugins/ChatPlugin/ChatUser/config.json rename to prompt_template_samples/ChatPlugin/ChatUser/config.json diff --git a/samples/plugins/ChatPlugin/ChatUser/skprompt.txt b/prompt_template_samples/ChatPlugin/ChatUser/skprompt.txt similarity index 100% rename from samples/plugins/ChatPlugin/ChatUser/skprompt.txt rename to prompt_template_samples/ChatPlugin/ChatUser/skprompt.txt diff --git a/samples/plugins/ChatPlugin/ChatV2/config.json b/prompt_template_samples/ChatPlugin/ChatV2/config.json similarity index 100% rename from samples/plugins/ChatPlugin/ChatV2/config.json rename to prompt_template_samples/ChatPlugin/ChatV2/config.json diff --git a/samples/plugins/ChatPlugin/ChatV2/skprompt.txt b/prompt_template_samples/ChatPlugin/ChatV2/skprompt.txt similarity index 100% rename from samples/plugins/ChatPlugin/ChatV2/skprompt.txt rename to prompt_template_samples/ChatPlugin/ChatV2/skprompt.txt diff --git a/samples/plugins/ChildrensBookPlugin/BookIdeas/config.json b/prompt_template_samples/ChildrensBookPlugin/BookIdeas/config.json similarity index 100% rename from samples/plugins/ChildrensBookPlugin/BookIdeas/config.json rename to prompt_template_samples/ChildrensBookPlugin/BookIdeas/config.json diff --git a/samples/plugins/ChildrensBookPlugin/BookIdeas/skprompt.txt b/prompt_template_samples/ChildrensBookPlugin/BookIdeas/skprompt.txt similarity index 100% rename from samples/plugins/ChildrensBookPlugin/BookIdeas/skprompt.txt rename to prompt_template_samples/ChildrensBookPlugin/BookIdeas/skprompt.txt diff --git a/samples/plugins/ChildrensBookPlugin/CreateBook/config.json b/prompt_template_samples/ChildrensBookPlugin/CreateBook/config.json similarity index 100% rename from samples/plugins/ChildrensBookPlugin/CreateBook/config.json rename to prompt_template_samples/ChildrensBookPlugin/CreateBook/config.json diff --git a/samples/plugins/ChildrensBookPlugin/CreateBook/skprompt.txt b/prompt_template_samples/ChildrensBookPlugin/CreateBook/skprompt.txt similarity index 100% rename from samples/plugins/ChildrensBookPlugin/CreateBook/skprompt.txt rename to prompt_template_samples/ChildrensBookPlugin/CreateBook/skprompt.txt diff --git a/samples/plugins/ClassificationPlugin/Importance/config.json b/prompt_template_samples/ClassificationPlugin/Importance/config.json similarity index 100% rename from samples/plugins/ClassificationPlugin/Importance/config.json rename to prompt_template_samples/ClassificationPlugin/Importance/config.json diff --git a/samples/plugins/ClassificationPlugin/Importance/skprompt.txt b/prompt_template_samples/ClassificationPlugin/Importance/skprompt.txt similarity index 100% rename from samples/plugins/ClassificationPlugin/Importance/skprompt.txt rename to prompt_template_samples/ClassificationPlugin/Importance/skprompt.txt diff --git a/samples/plugins/ClassificationPlugin/Question/config.json b/prompt_template_samples/ClassificationPlugin/Question/config.json similarity index 100% rename from samples/plugins/ClassificationPlugin/Question/config.json rename to prompt_template_samples/ClassificationPlugin/Question/config.json diff --git a/samples/plugins/ClassificationPlugin/Question/skprompt.txt b/prompt_template_samples/ClassificationPlugin/Question/skprompt.txt similarity index 100% rename from samples/plugins/ClassificationPlugin/Question/skprompt.txt rename to prompt_template_samples/ClassificationPlugin/Question/skprompt.txt diff --git a/samples/plugins/CodingPlugin/Code/config.json b/prompt_template_samples/CodingPlugin/Code/config.json similarity index 100% rename from samples/plugins/CodingPlugin/Code/config.json rename to prompt_template_samples/CodingPlugin/Code/config.json diff --git a/samples/plugins/CodingPlugin/Code/skprompt.txt b/prompt_template_samples/CodingPlugin/Code/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/Code/skprompt.txt rename to prompt_template_samples/CodingPlugin/Code/skprompt.txt diff --git a/samples/plugins/CodingPlugin/CodePython/config.json b/prompt_template_samples/CodingPlugin/CodePython/config.json similarity index 100% rename from samples/plugins/CodingPlugin/CodePython/config.json rename to prompt_template_samples/CodingPlugin/CodePython/config.json diff --git a/samples/plugins/CodingPlugin/CodePython/skprompt.txt b/prompt_template_samples/CodingPlugin/CodePython/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/CodePython/skprompt.txt rename to prompt_template_samples/CodingPlugin/CodePython/skprompt.txt diff --git a/samples/plugins/CodingPlugin/CommandLinePython/config.json b/prompt_template_samples/CodingPlugin/CommandLinePython/config.json similarity index 100% rename from samples/plugins/CodingPlugin/CommandLinePython/config.json rename to prompt_template_samples/CodingPlugin/CommandLinePython/config.json diff --git a/samples/plugins/CodingPlugin/CommandLinePython/skprompt.txt b/prompt_template_samples/CodingPlugin/CommandLinePython/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/CommandLinePython/skprompt.txt rename to prompt_template_samples/CodingPlugin/CommandLinePython/skprompt.txt diff --git a/samples/plugins/CodingPlugin/DOSScript/config.json b/prompt_template_samples/CodingPlugin/DOSScript/config.json similarity index 100% rename from samples/plugins/CodingPlugin/DOSScript/config.json rename to prompt_template_samples/CodingPlugin/DOSScript/config.json diff --git a/samples/plugins/CodingPlugin/DOSScript/skprompt.txt b/prompt_template_samples/CodingPlugin/DOSScript/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/DOSScript/skprompt.txt rename to prompt_template_samples/CodingPlugin/DOSScript/skprompt.txt diff --git a/samples/plugins/CodingPlugin/EmailSearch/config.json b/prompt_template_samples/CodingPlugin/EmailSearch/config.json similarity index 100% rename from samples/plugins/CodingPlugin/EmailSearch/config.json rename to prompt_template_samples/CodingPlugin/EmailSearch/config.json diff --git a/samples/plugins/CodingPlugin/EmailSearch/skprompt.txt b/prompt_template_samples/CodingPlugin/EmailSearch/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/EmailSearch/skprompt.txt rename to prompt_template_samples/CodingPlugin/EmailSearch/skprompt.txt diff --git a/samples/plugins/CodingPlugin/Entity/config.json b/prompt_template_samples/CodingPlugin/Entity/config.json similarity index 100% rename from samples/plugins/CodingPlugin/Entity/config.json rename to prompt_template_samples/CodingPlugin/Entity/config.json diff --git a/samples/plugins/CodingPlugin/Entity/skprompt.txt b/prompt_template_samples/CodingPlugin/Entity/skprompt.txt similarity index 100% rename from samples/plugins/CodingPlugin/Entity/skprompt.txt rename to prompt_template_samples/CodingPlugin/Entity/skprompt.txt diff --git a/samples/plugins/FunPlugin/Excuses/config.json b/prompt_template_samples/FunPlugin/Excuses/config.json similarity index 100% rename from samples/plugins/FunPlugin/Excuses/config.json rename to prompt_template_samples/FunPlugin/Excuses/config.json diff --git a/samples/plugins/FunPlugin/Excuses/skprompt.txt b/prompt_template_samples/FunPlugin/Excuses/skprompt.txt similarity index 100% rename from samples/plugins/FunPlugin/Excuses/skprompt.txt rename to prompt_template_samples/FunPlugin/Excuses/skprompt.txt diff --git a/samples/plugins/FunPlugin/Joke/config.json b/prompt_template_samples/FunPlugin/Joke/config.json similarity index 100% rename from samples/plugins/FunPlugin/Joke/config.json rename to prompt_template_samples/FunPlugin/Joke/config.json diff --git a/samples/plugins/FunPlugin/Joke/skprompt.txt b/prompt_template_samples/FunPlugin/Joke/skprompt.txt similarity index 100% rename from samples/plugins/FunPlugin/Joke/skprompt.txt rename to prompt_template_samples/FunPlugin/Joke/skprompt.txt diff --git a/samples/plugins/FunPlugin/Limerick/config.json b/prompt_template_samples/FunPlugin/Limerick/config.json similarity index 100% rename from samples/plugins/FunPlugin/Limerick/config.json rename to prompt_template_samples/FunPlugin/Limerick/config.json diff --git a/samples/plugins/FunPlugin/Limerick/skprompt.txt b/prompt_template_samples/FunPlugin/Limerick/skprompt.txt similarity index 100% rename from samples/plugins/FunPlugin/Limerick/skprompt.txt rename to prompt_template_samples/FunPlugin/Limerick/skprompt.txt diff --git a/samples/plugins/GroundingPlugin/ExciseEntities/config.json b/prompt_template_samples/GroundingPlugin/ExciseEntities/config.json similarity index 100% rename from samples/plugins/GroundingPlugin/ExciseEntities/config.json rename to prompt_template_samples/GroundingPlugin/ExciseEntities/config.json diff --git a/samples/plugins/GroundingPlugin/ExciseEntities/skprompt.txt b/prompt_template_samples/GroundingPlugin/ExciseEntities/skprompt.txt similarity index 100% rename from samples/plugins/GroundingPlugin/ExciseEntities/skprompt.txt rename to prompt_template_samples/GroundingPlugin/ExciseEntities/skprompt.txt diff --git a/samples/plugins/GroundingPlugin/ExtractEntities/config.json b/prompt_template_samples/GroundingPlugin/ExtractEntities/config.json similarity index 100% rename from samples/plugins/GroundingPlugin/ExtractEntities/config.json rename to prompt_template_samples/GroundingPlugin/ExtractEntities/config.json diff --git a/samples/plugins/GroundingPlugin/ExtractEntities/skprompt.txt b/prompt_template_samples/GroundingPlugin/ExtractEntities/skprompt.txt similarity index 100% rename from samples/plugins/GroundingPlugin/ExtractEntities/skprompt.txt rename to prompt_template_samples/GroundingPlugin/ExtractEntities/skprompt.txt diff --git a/samples/plugins/GroundingPlugin/ReferenceCheckEntities/config.json b/prompt_template_samples/GroundingPlugin/ReferenceCheckEntities/config.json similarity index 100% rename from samples/plugins/GroundingPlugin/ReferenceCheckEntities/config.json rename to prompt_template_samples/GroundingPlugin/ReferenceCheckEntities/config.json diff --git a/samples/plugins/GroundingPlugin/ReferenceCheckEntities/skprompt.txt b/prompt_template_samples/GroundingPlugin/ReferenceCheckEntities/skprompt.txt similarity index 100% rename from samples/plugins/GroundingPlugin/ReferenceCheckEntities/skprompt.txt rename to prompt_template_samples/GroundingPlugin/ReferenceCheckEntities/skprompt.txt diff --git a/samples/plugins/IntentDetectionPlugin/AssistantIntent/config.json b/prompt_template_samples/IntentDetectionPlugin/AssistantIntent/config.json similarity index 100% rename from samples/plugins/IntentDetectionPlugin/AssistantIntent/config.json rename to prompt_template_samples/IntentDetectionPlugin/AssistantIntent/config.json diff --git a/samples/plugins/IntentDetectionPlugin/AssistantIntent/skprompt.txt b/prompt_template_samples/IntentDetectionPlugin/AssistantIntent/skprompt.txt similarity index 100% rename from samples/plugins/IntentDetectionPlugin/AssistantIntent/skprompt.txt rename to prompt_template_samples/IntentDetectionPlugin/AssistantIntent/skprompt.txt diff --git a/samples/plugins/MiscPlugin/Continue/config.json b/prompt_template_samples/MiscPlugin/Continue/config.json similarity index 100% rename from samples/plugins/MiscPlugin/Continue/config.json rename to prompt_template_samples/MiscPlugin/Continue/config.json diff --git a/samples/plugins/MiscPlugin/Continue/skprompt.txt b/prompt_template_samples/MiscPlugin/Continue/skprompt.txt similarity index 100% rename from samples/plugins/MiscPlugin/Continue/skprompt.txt rename to prompt_template_samples/MiscPlugin/Continue/skprompt.txt diff --git a/samples/plugins/MiscPlugin/ElementAtIndex/config.json b/prompt_template_samples/MiscPlugin/ElementAtIndex/config.json similarity index 100% rename from samples/plugins/MiscPlugin/ElementAtIndex/config.json rename to prompt_template_samples/MiscPlugin/ElementAtIndex/config.json diff --git a/samples/plugins/MiscPlugin/ElementAtIndex/skprompt.txt b/prompt_template_samples/MiscPlugin/ElementAtIndex/skprompt.txt similarity index 100% rename from samples/plugins/MiscPlugin/ElementAtIndex/skprompt.txt rename to prompt_template_samples/MiscPlugin/ElementAtIndex/skprompt.txt diff --git a/samples/plugins/QAPlugin/AssistantResults/config.json b/prompt_template_samples/QAPlugin/AssistantResults/config.json similarity index 100% rename from samples/plugins/QAPlugin/AssistantResults/config.json rename to prompt_template_samples/QAPlugin/AssistantResults/config.json diff --git a/samples/plugins/QAPlugin/AssistantResults/skprompt.txt b/prompt_template_samples/QAPlugin/AssistantResults/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/AssistantResults/skprompt.txt rename to prompt_template_samples/QAPlugin/AssistantResults/skprompt.txt diff --git a/samples/plugins/QAPlugin/ContextQuery/config.json b/prompt_template_samples/QAPlugin/ContextQuery/config.json similarity index 100% rename from samples/plugins/QAPlugin/ContextQuery/config.json rename to prompt_template_samples/QAPlugin/ContextQuery/config.json diff --git a/samples/plugins/QAPlugin/ContextQuery/skprompt.txt b/prompt_template_samples/QAPlugin/ContextQuery/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/ContextQuery/skprompt.txt rename to prompt_template_samples/QAPlugin/ContextQuery/skprompt.txt diff --git a/samples/plugins/QAPlugin/Form/config.json b/prompt_template_samples/QAPlugin/Form/config.json similarity index 100% rename from samples/plugins/QAPlugin/Form/config.json rename to prompt_template_samples/QAPlugin/Form/config.json diff --git a/samples/plugins/QAPlugin/Form/skprompt.txt b/prompt_template_samples/QAPlugin/Form/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/Form/skprompt.txt rename to prompt_template_samples/QAPlugin/Form/skprompt.txt diff --git a/samples/plugins/QAPlugin/GitHubMemoryQuery/config.json b/prompt_template_samples/QAPlugin/GitHubMemoryQuery/config.json similarity index 100% rename from samples/plugins/QAPlugin/GitHubMemoryQuery/config.json rename to prompt_template_samples/QAPlugin/GitHubMemoryQuery/config.json diff --git a/samples/plugins/QAPlugin/GitHubMemoryQuery/skprompt.txt b/prompt_template_samples/QAPlugin/GitHubMemoryQuery/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/GitHubMemoryQuery/skprompt.txt rename to prompt_template_samples/QAPlugin/GitHubMemoryQuery/skprompt.txt diff --git a/samples/plugins/QAPlugin/QNA/config.json b/prompt_template_samples/QAPlugin/QNA/config.json similarity index 100% rename from samples/plugins/QAPlugin/QNA/config.json rename to prompt_template_samples/QAPlugin/QNA/config.json diff --git a/samples/plugins/QAPlugin/QNA/skprompt.txt b/prompt_template_samples/QAPlugin/QNA/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/QNA/skprompt.txt rename to prompt_template_samples/QAPlugin/QNA/skprompt.txt diff --git a/samples/plugins/QAPlugin/Question/config.json b/prompt_template_samples/QAPlugin/Question/config.json similarity index 100% rename from samples/plugins/QAPlugin/Question/config.json rename to prompt_template_samples/QAPlugin/Question/config.json diff --git a/samples/plugins/QAPlugin/Question/skprompt.txt b/prompt_template_samples/QAPlugin/Question/skprompt.txt similarity index 100% rename from samples/plugins/QAPlugin/Question/skprompt.txt rename to prompt_template_samples/QAPlugin/Question/skprompt.txt diff --git a/samples/plugins/SummarizePlugin/MakeAbstractReadable/config.json b/prompt_template_samples/SummarizePlugin/MakeAbstractReadable/config.json similarity index 100% rename from samples/plugins/SummarizePlugin/MakeAbstractReadable/config.json rename to prompt_template_samples/SummarizePlugin/MakeAbstractReadable/config.json diff --git a/samples/plugins/SummarizePlugin/MakeAbstractReadable/skprompt.txt b/prompt_template_samples/SummarizePlugin/MakeAbstractReadable/skprompt.txt similarity index 100% rename from samples/plugins/SummarizePlugin/MakeAbstractReadable/skprompt.txt rename to prompt_template_samples/SummarizePlugin/MakeAbstractReadable/skprompt.txt diff --git a/samples/plugins/SummarizePlugin/Notegen/config.json b/prompt_template_samples/SummarizePlugin/Notegen/config.json similarity index 100% rename from samples/plugins/SummarizePlugin/Notegen/config.json rename to prompt_template_samples/SummarizePlugin/Notegen/config.json diff --git a/samples/plugins/SummarizePlugin/Notegen/skprompt.txt b/prompt_template_samples/SummarizePlugin/Notegen/skprompt.txt similarity index 100% rename from samples/plugins/SummarizePlugin/Notegen/skprompt.txt rename to prompt_template_samples/SummarizePlugin/Notegen/skprompt.txt diff --git a/samples/plugins/SummarizePlugin/Summarize/config.json b/prompt_template_samples/SummarizePlugin/Summarize/config.json similarity index 100% rename from samples/plugins/SummarizePlugin/Summarize/config.json rename to prompt_template_samples/SummarizePlugin/Summarize/config.json diff --git a/samples/plugins/SummarizePlugin/Summarize/skprompt.txt b/prompt_template_samples/SummarizePlugin/Summarize/skprompt.txt similarity index 100% rename from samples/plugins/SummarizePlugin/Summarize/skprompt.txt rename to prompt_template_samples/SummarizePlugin/Summarize/skprompt.txt diff --git a/samples/plugins/SummarizePlugin/Topics/config.json b/prompt_template_samples/SummarizePlugin/Topics/config.json similarity index 100% rename from samples/plugins/SummarizePlugin/Topics/config.json rename to prompt_template_samples/SummarizePlugin/Topics/config.json diff --git a/samples/plugins/SummarizePlugin/Topics/skprompt.txt b/prompt_template_samples/SummarizePlugin/Topics/skprompt.txt similarity index 100% rename from samples/plugins/SummarizePlugin/Topics/skprompt.txt rename to prompt_template_samples/SummarizePlugin/Topics/skprompt.txt diff --git a/samples/plugins/WriterPlugin/Acronym/config.json b/prompt_template_samples/WriterPlugin/Acronym/config.json similarity index 100% rename from samples/plugins/WriterPlugin/Acronym/config.json rename to prompt_template_samples/WriterPlugin/Acronym/config.json diff --git a/samples/plugins/WriterPlugin/Acronym/skprompt.txt b/prompt_template_samples/WriterPlugin/Acronym/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/Acronym/skprompt.txt rename to prompt_template_samples/WriterPlugin/Acronym/skprompt.txt diff --git a/samples/plugins/WriterPlugin/AcronymGenerator/config.json b/prompt_template_samples/WriterPlugin/AcronymGenerator/config.json similarity index 100% rename from samples/plugins/WriterPlugin/AcronymGenerator/config.json rename to prompt_template_samples/WriterPlugin/AcronymGenerator/config.json diff --git a/samples/plugins/WriterPlugin/AcronymGenerator/skprompt.txt b/prompt_template_samples/WriterPlugin/AcronymGenerator/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/AcronymGenerator/skprompt.txt rename to prompt_template_samples/WriterPlugin/AcronymGenerator/skprompt.txt diff --git a/samples/plugins/WriterPlugin/AcronymReverse/config.json b/prompt_template_samples/WriterPlugin/AcronymReverse/config.json similarity index 100% rename from samples/plugins/WriterPlugin/AcronymReverse/config.json rename to prompt_template_samples/WriterPlugin/AcronymReverse/config.json diff --git a/samples/plugins/WriterPlugin/AcronymReverse/skprompt.txt b/prompt_template_samples/WriterPlugin/AcronymReverse/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/AcronymReverse/skprompt.txt rename to prompt_template_samples/WriterPlugin/AcronymReverse/skprompt.txt diff --git a/samples/plugins/WriterPlugin/Brainstorm/config.json b/prompt_template_samples/WriterPlugin/Brainstorm/config.json similarity index 100% rename from samples/plugins/WriterPlugin/Brainstorm/config.json rename to prompt_template_samples/WriterPlugin/Brainstorm/config.json diff --git a/samples/plugins/WriterPlugin/Brainstorm/skprompt.txt b/prompt_template_samples/WriterPlugin/Brainstorm/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/Brainstorm/skprompt.txt rename to prompt_template_samples/WriterPlugin/Brainstorm/skprompt.txt diff --git a/samples/plugins/WriterPlugin/EmailGen/config.json b/prompt_template_samples/WriterPlugin/EmailGen/config.json similarity index 100% rename from samples/plugins/WriterPlugin/EmailGen/config.json rename to prompt_template_samples/WriterPlugin/EmailGen/config.json diff --git a/samples/plugins/WriterPlugin/EmailGen/skprompt.txt b/prompt_template_samples/WriterPlugin/EmailGen/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/EmailGen/skprompt.txt rename to prompt_template_samples/WriterPlugin/EmailGen/skprompt.txt diff --git a/samples/plugins/WriterPlugin/EmailTo/config.json b/prompt_template_samples/WriterPlugin/EmailTo/config.json similarity index 100% rename from samples/plugins/WriterPlugin/EmailTo/config.json rename to prompt_template_samples/WriterPlugin/EmailTo/config.json diff --git a/samples/plugins/WriterPlugin/EmailTo/skprompt.txt b/prompt_template_samples/WriterPlugin/EmailTo/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/EmailTo/skprompt.txt rename to prompt_template_samples/WriterPlugin/EmailTo/skprompt.txt diff --git a/samples/plugins/WriterPlugin/EnglishImprover/config.json b/prompt_template_samples/WriterPlugin/EnglishImprover/config.json similarity index 100% rename from samples/plugins/WriterPlugin/EnglishImprover/config.json rename to prompt_template_samples/WriterPlugin/EnglishImprover/config.json diff --git a/samples/plugins/WriterPlugin/EnglishImprover/skprompt.txt b/prompt_template_samples/WriterPlugin/EnglishImprover/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/EnglishImprover/skprompt.txt rename to prompt_template_samples/WriterPlugin/EnglishImprover/skprompt.txt diff --git a/samples/plugins/WriterPlugin/NovelChapter/config.json b/prompt_template_samples/WriterPlugin/NovelChapter/config.json similarity index 100% rename from samples/plugins/WriterPlugin/NovelChapter/config.json rename to prompt_template_samples/WriterPlugin/NovelChapter/config.json diff --git a/samples/plugins/WriterPlugin/NovelChapter/skprompt.txt b/prompt_template_samples/WriterPlugin/NovelChapter/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/NovelChapter/skprompt.txt rename to prompt_template_samples/WriterPlugin/NovelChapter/skprompt.txt diff --git a/samples/plugins/WriterPlugin/NovelChapterWithNotes/config.json b/prompt_template_samples/WriterPlugin/NovelChapterWithNotes/config.json similarity index 100% rename from samples/plugins/WriterPlugin/NovelChapterWithNotes/config.json rename to prompt_template_samples/WriterPlugin/NovelChapterWithNotes/config.json diff --git a/samples/plugins/WriterPlugin/NovelChapterWithNotes/skprompt.txt b/prompt_template_samples/WriterPlugin/NovelChapterWithNotes/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/NovelChapterWithNotes/skprompt.txt rename to prompt_template_samples/WriterPlugin/NovelChapterWithNotes/skprompt.txt diff --git a/samples/plugins/WriterPlugin/NovelOutline/config.json b/prompt_template_samples/WriterPlugin/NovelOutline/config.json similarity index 100% rename from samples/plugins/WriterPlugin/NovelOutline/config.json rename to prompt_template_samples/WriterPlugin/NovelOutline/config.json diff --git a/samples/plugins/WriterPlugin/NovelOutline/skprompt.txt b/prompt_template_samples/WriterPlugin/NovelOutline/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/NovelOutline/skprompt.txt rename to prompt_template_samples/WriterPlugin/NovelOutline/skprompt.txt diff --git a/samples/plugins/WriterPlugin/Rewrite/config.json b/prompt_template_samples/WriterPlugin/Rewrite/config.json similarity index 100% rename from samples/plugins/WriterPlugin/Rewrite/config.json rename to prompt_template_samples/WriterPlugin/Rewrite/config.json diff --git a/samples/plugins/WriterPlugin/Rewrite/skprompt.txt b/prompt_template_samples/WriterPlugin/Rewrite/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/Rewrite/skprompt.txt rename to prompt_template_samples/WriterPlugin/Rewrite/skprompt.txt diff --git a/samples/plugins/WriterPlugin/ShortPoem/config.json b/prompt_template_samples/WriterPlugin/ShortPoem/config.json similarity index 100% rename from samples/plugins/WriterPlugin/ShortPoem/config.json rename to prompt_template_samples/WriterPlugin/ShortPoem/config.json diff --git a/python/samples/documentation_examples/plugins/WriterPlugin/ShortPoem/skprompt.txt b/prompt_template_samples/WriterPlugin/ShortPoem/skprompt.txt similarity index 100% rename from python/samples/documentation_examples/plugins/WriterPlugin/ShortPoem/skprompt.txt rename to prompt_template_samples/WriterPlugin/ShortPoem/skprompt.txt diff --git a/samples/plugins/WriterPlugin/StoryGen/config.json b/prompt_template_samples/WriterPlugin/StoryGen/config.json similarity index 100% rename from samples/plugins/WriterPlugin/StoryGen/config.json rename to prompt_template_samples/WriterPlugin/StoryGen/config.json diff --git a/samples/plugins/WriterPlugin/StoryGen/skprompt.txt b/prompt_template_samples/WriterPlugin/StoryGen/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/StoryGen/skprompt.txt rename to prompt_template_samples/WriterPlugin/StoryGen/skprompt.txt diff --git a/samples/plugins/WriterPlugin/TellMeMore/config.json b/prompt_template_samples/WriterPlugin/TellMeMore/config.json similarity index 100% rename from samples/plugins/WriterPlugin/TellMeMore/config.json rename to prompt_template_samples/WriterPlugin/TellMeMore/config.json diff --git a/samples/plugins/WriterPlugin/TellMeMore/skprompt.txt b/prompt_template_samples/WriterPlugin/TellMeMore/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/TellMeMore/skprompt.txt rename to prompt_template_samples/WriterPlugin/TellMeMore/skprompt.txt diff --git a/samples/plugins/WriterPlugin/Translate/config.json b/prompt_template_samples/WriterPlugin/Translate/config.json similarity index 100% rename from samples/plugins/WriterPlugin/Translate/config.json rename to prompt_template_samples/WriterPlugin/Translate/config.json diff --git a/samples/plugins/WriterPlugin/Translate/skprompt.txt b/prompt_template_samples/WriterPlugin/Translate/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/Translate/skprompt.txt rename to prompt_template_samples/WriterPlugin/Translate/skprompt.txt diff --git a/samples/plugins/WriterPlugin/TwoSentenceSummary/config.json b/prompt_template_samples/WriterPlugin/TwoSentenceSummary/config.json similarity index 100% rename from samples/plugins/WriterPlugin/TwoSentenceSummary/config.json rename to prompt_template_samples/WriterPlugin/TwoSentenceSummary/config.json diff --git a/samples/plugins/WriterPlugin/TwoSentenceSummary/skprompt.txt b/prompt_template_samples/WriterPlugin/TwoSentenceSummary/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/TwoSentenceSummary/skprompt.txt rename to prompt_template_samples/WriterPlugin/TwoSentenceSummary/skprompt.txt diff --git a/python/DEV_SETUP.md b/python/DEV_SETUP.md index fceda780ff84..126fd62d2b48 100644 --- a/python/DEV_SETUP.md +++ b/python/DEV_SETUP.md @@ -23,7 +23,7 @@ AZURE_OPENAI_API_KEY="" We suggest adding a copy of the `.env` file under these folders: - [python/tests](tests) -- [./notebooks](./notebooks). +- [./samples/getting_started](./samples/getting_started). ## System setup @@ -133,12 +133,12 @@ Alternatively, you can run them using VSCode Tasks. Open the command palette ## Tools and scripts -## Implementation Decisions +## Implementation Decisions ### Asynchronous programming -It's important to note that most of this library is written with asynchronous in mind. The -developer should always assume everything is asynchronous. One can use the function signature +It's important to note that most of this library is written with asynchronous in mind. The +developer should always assume everything is asynchronous. One can use the function signature with either `async def` or `def` to understand if something is asynchronous or not. ## Pydantic and Serialization diff --git a/python/README.md b/python/README.md index 92a1dd6e4c6b..57e55c290e9c 100644 --- a/python/README.md +++ b/python/README.md @@ -148,18 +148,18 @@ get started with the Semantic Kernel. Python notebooks: -- [Getting started with Semantic Kernel](./notebooks/00-getting-started.ipynb) -- [Loading and configuring Semantic Kernel](./notebooks/01-basic-loading-the-kernel.ipynb) -- [Running AI prompts from file](./notebooks/02-running-prompts-from-file.ipynb) -- [Creating Prompt Functions at runtime (i.e. inline functions)](./notebooks/03-prompt-function-inline.ipynb) -- [Using Context Variables to Build a Chat Experience](./notebooks/04-kernel-arguments-chat.ipynb) -- [Introduction to planners](./notebooks/05-using-the-planner.ipynb) -- [Building Memory with Embeddings](./notebooks/06-memory-and-embeddings.ipynb) -- [Using Hugging Face for Plugins](./notebooks/07-hugging-face-for-plugins.ipynb) -- [Combining native functions and semantic functions](./notebooks/08-native-function-inline.ipynb) -- [Groundedness Checking with Semantic Kernel](./notebooks/09-groundedness-checking.ipynb) -- [Returning multiple results per prompt](./notebooks/10-multiple-results-per-prompt.ipynb) -- [Streaming completions with Semantic Kernel](./notebooks/11-streaming-completions.ipynb) +- [Getting started with Semantic Kernel](./samples/getting_started/00-getting-started.ipynb) +- [Loading and configuring Semantic Kernel](./samples/getting_started/01-basic-loading-the-kernel.ipynb) +- [Running AI prompts from file](./samples/getting_started/02-running-prompts-from-file.ipynb) +- [Creating Prompt Functions at runtime (i.e. inline functions)](./samples/getting_started/03-prompt-function-inline.ipynb) +- [Using Context Variables to Build a Chat Experience](./samples/getting_started/04-kernel-arguments-chat.ipynb) +- [Introduction to planners](./samples/getting_started/05-using-the-planner.ipynb) +- [Building Memory with Embeddings](./samples/getting_started/06-memory-and-embeddings.ipynb) +- [Using Hugging Face for Plugins](./samples/getting_started/07-hugging-face-for-plugins.ipynb) +- [Combining native functions and semantic functions](./samples/getting_started/08-native-function-inline.ipynb) +- [Groundedness Checking with Semantic Kernel](./samples/getting_started/09-groundedness-checking.ipynb) +- [Returning multiple results per prompt](./samples/getting_started/10-multiple-results-per-prompt.ipynb) +- [Streaming completions with Semantic Kernel](./samples/getting_started/11-streaming-completions.ipynb) # SK Frequently Asked Questions diff --git a/python/samples/concepts/README.md b/python/samples/concepts/README.md new file mode 100644 index 000000000000..be9702c2edbb --- /dev/null +++ b/python/samples/concepts/README.md @@ -0,0 +1,19 @@ +# Semantic Kernel Concepts by Feature + +This section contains code snippets that demonstrate the usage of Semantic Kernel features. + +| Features | Description | +| -------- | ----------- | +| AutoFunctionCalling | Using `Auto Function Calling` to allow function call capable models to invoke Kernel Functions automatically | +| ChatCompletion | Using [`ChatCompletion`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/ai/chat_completion_client_base.py) messaging capable service with models | +| Functions | Invoking [`Method`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/functions/kernel_function_from_method.py) or [`Prompt`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/functions/kernel_function_from_prompt.py) functions with [`Kernel`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/kernel.py) | +| Grounding | An example of how to perform LLM grounding | +| Logging | Showing how to set up logging | +| Memory | Using [`Memory`](https://github.com/microsoft/semantic-kernel/tree/main/dotnet/src/SemanticKernel.Abstractions/Memory) AI concepts | +| On Your Data | Examples of using AzureOpenAI [`On Your Data`](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data?tabs=mongo-db) | +| Planners | Showing the uses of [`Planners`](https://github.com/microsoft/semantic-kernel/tree/main/python/semantic_kernel/planners) | +| Plugins | Different ways of creating and using [`Plugins`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/functions/kernel_plugin.py) | +| PromptTemplates | Using [`Templates`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/prompt_template/prompt_template_base.py) with parametrization for `Prompt` rendering | +| RAG | Different ways of `RAG` (Retrieval-Augmented Generation) | +| Search | Using search services information | +| TextGeneration | Using [`TextGeneration`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/ai/text_completion_client_base.py) capable service with models | diff --git a/python/samples/kernel-syntax-examples/chat_gpt_api_function_calling.py b/python/samples/concepts/auto_function_calling/chat_gpt_api_function_calling.py similarity index 100% rename from python/samples/kernel-syntax-examples/chat_gpt_api_function_calling.py rename to python/samples/concepts/auto_function_calling/chat_gpt_api_function_calling.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_api.py b/python/samples/concepts/chat_completion/azure_chat_gpt_api.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_api.py rename to python/samples/concepts/chat_completion/azure_chat_gpt_api.py diff --git a/python/samples/kernel-syntax-examples/chat.py b/python/samples/concepts/chat_completion/chat.py similarity index 100% rename from python/samples/kernel-syntax-examples/chat.py rename to python/samples/concepts/chat_completion/chat.py diff --git a/python/samples/kernel-syntax-examples/chat_gpt_api.py b/python/samples/concepts/chat_completion/chat_gpt_api.py similarity index 100% rename from python/samples/kernel-syntax-examples/chat_gpt_api.py rename to python/samples/concepts/chat_completion/chat_gpt_api.py diff --git a/python/samples/kernel-syntax-examples/openai_logit_bias.py b/python/samples/concepts/chat_completion/openai_logit_bias.py similarity index 100% rename from python/samples/kernel-syntax-examples/openai_logit_bias.py rename to python/samples/concepts/chat_completion/openai_logit_bias.py diff --git a/python/samples/concepts/functions/kernel_arguments.py b/python/samples/concepts/functions/kernel_arguments.py new file mode 100644 index 000000000000..0d4641bfc8d0 --- /dev/null +++ b/python/samples/concepts/functions/kernel_arguments.py @@ -0,0 +1,72 @@ +# Copyright (c) Microsoft. All rights reserved. + +from __future__ import annotations + +import asyncio +import datetime +import locale +from typing import Annotated + +from semantic_kernel.functions.kernel_arguments import KernelArguments +from semantic_kernel.functions.kernel_function_decorator import kernel_function +from semantic_kernel.kernel import Kernel + +# This example shows how to use kernel arguments when invoking functions. + + +class StaticTextPlugin: + """A plugin for generating static text.""" + + @kernel_function(name="uppercase", description="Convert text to uppercase") + def uppercase( + self, text: Annotated[str, "The input text"] + ) -> Annotated[str, "The output is the text in uppercase"]: + """Convert text to uppercase. + + Args: + text (str): The text to convert to uppercase. + + Returns: + str: The text in uppercase. + """ + return text.upper() + + @kernel_function(name="append_day", description="Append the day variable") + def append_day( + self, input: Annotated[str, "The input text"], day: Annotated[str, "The day to append"] + ) -> Annotated[str, "The output is the text with the day appended"]: + """Append the day variable. + + Args: + input (str): The input text to append the day to. + day (str): The day to append. + + Returns: + str: The text with the day appended. + """ + return f"{input} {day}" + + +def get_day_of_week_for_locale(): + """Get the day of the week for the current locale.""" + locale.setlocale(locale.LC_TIME, "") + return datetime.datetime.now().strftime("%A") + + +async def main(): + kernel = Kernel() + + text_plugin = kernel.add_plugin(StaticTextPlugin(), "TextPlugin") + arguments = KernelArguments(input="Today is:", day=get_day_of_week_for_locale()) + + result = await kernel.invoke(text_plugin["append_day"], arguments) + + # The result returned is of type FunctionResult. Printing the result calls the __str__ method. + print(result) + + # Note: if you need access to the result metadata, you can do the following + # metadata = result.metadata + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/python/samples/kernel-syntax-examples/grounded.py b/python/samples/concepts/grounding/grounded.py similarity index 100% rename from python/samples/kernel-syntax-examples/grounded.py rename to python/samples/concepts/grounding/grounded.py diff --git a/python/samples/kernel-syntax-examples/setup_logging.py b/python/samples/concepts/logging/setup_logging.py similarity index 100% rename from python/samples/kernel-syntax-examples/setup_logging.py rename to python/samples/concepts/logging/setup_logging.py diff --git a/python/samples/kernel-syntax-examples/azure_cognitive_search_memory.py b/python/samples/concepts/memory/azure_cognitive_search_memory.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_cognitive_search_memory.py rename to python/samples/concepts/memory/azure_cognitive_search_memory.py diff --git a/python/samples/kernel-syntax-examples/google_palm_chat_with_memory.py b/python/samples/concepts/memory/google_palm_chat_with_memory.py similarity index 100% rename from python/samples/kernel-syntax-examples/google_palm_chat_with_memory.py rename to python/samples/concepts/memory/google_palm_chat_with_memory.py diff --git a/python/samples/kernel-syntax-examples/memory.py b/python/samples/concepts/memory/memory.py similarity index 100% rename from python/samples/kernel-syntax-examples/memory.py rename to python/samples/concepts/memory/memory.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api.py b/python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api.py rename to python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api_function_calling.py b/python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_function_calling.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api_function_calling.py rename to python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_function_calling.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api_vector_search.py b/python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_vector_search.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_with_data_api_vector_search.py rename to python/samples/concepts/on_your_data/azure_chat_gpt_with_data_api_vector_search.py diff --git a/python/samples/kernel-syntax-examples/action_planner.py b/python/samples/concepts/planners/action_planner.py similarity index 100% rename from python/samples/kernel-syntax-examples/action_planner.py rename to python/samples/concepts/planners/action_planner.py diff --git a/python/samples/kernel-syntax-examples/azure_openai_function_calling_stepwise_planner.py b/python/samples/concepts/planners/azure_openai_function_calling_stepwise_planner.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_openai_function_calling_stepwise_planner.py rename to python/samples/concepts/planners/azure_openai_function_calling_stepwise_planner.py diff --git a/python/samples/kernel-syntax-examples/openai_function_calling_stepwise_planner.py b/python/samples/concepts/planners/openai_function_calling_stepwise_planner.py similarity index 100% rename from python/samples/kernel-syntax-examples/openai_function_calling_stepwise_planner.py rename to python/samples/concepts/planners/openai_function_calling_stepwise_planner.py diff --git a/python/samples/kernel-syntax-examples/sequential_planner.py b/python/samples/concepts/planners/sequential_planner.py similarity index 100% rename from python/samples/kernel-syntax-examples/sequential_planner.py rename to python/samples/concepts/planners/sequential_planner.py diff --git a/python/samples/kernel-syntax-examples/google_palm_chat_with_plugin.py b/python/samples/concepts/plugins/google_palm_chat_with_plugin.py similarity index 100% rename from python/samples/kernel-syntax-examples/google_palm_chat_with_plugin.py rename to python/samples/concepts/plugins/google_palm_chat_with_plugin.py diff --git a/python/samples/kernel-syntax-examples/openai_function_calling_with_custom_plugin.py b/python/samples/concepts/plugins/openai_function_calling_with_custom_plugin.py similarity index 100% rename from python/samples/kernel-syntax-examples/openai_function_calling_with_custom_plugin.py rename to python/samples/concepts/plugins/openai_function_calling_with_custom_plugin.py diff --git a/python/samples/kernel-syntax-examples/openai_plugin_azure_key_vault.py b/python/samples/concepts/plugins/openai_plugin_azure_key_vault.py similarity index 100% rename from python/samples/kernel-syntax-examples/openai_plugin_azure_key_vault.py rename to python/samples/concepts/plugins/openai_plugin_azure_key_vault.py diff --git a/python/samples/kernel-syntax-examples/openai_plugin_klarna.py b/python/samples/concepts/plugins/openai_plugin_klarna.py similarity index 100% rename from python/samples/kernel-syntax-examples/openai_plugin_klarna.py rename to python/samples/concepts/plugins/openai_plugin_klarna.py diff --git a/python/samples/kernel-syntax-examples/openapi_example/README.md b/python/samples/concepts/plugins/openapi/README.md similarity index 100% rename from python/samples/kernel-syntax-examples/openapi_example/README.md rename to python/samples/concepts/plugins/openapi/README.md diff --git a/python/samples/kernel-syntax-examples/openapi_example/openapi.yaml b/python/samples/concepts/plugins/openapi/openapi.yaml similarity index 100% rename from python/samples/kernel-syntax-examples/openapi_example/openapi.yaml rename to python/samples/concepts/plugins/openapi/openapi.yaml diff --git a/python/samples/kernel-syntax-examples/openapi_example/openapi_client.py b/python/samples/concepts/plugins/openapi/openapi_client.py similarity index 100% rename from python/samples/kernel-syntax-examples/openapi_example/openapi_client.py rename to python/samples/concepts/plugins/openapi/openapi_client.py diff --git a/python/samples/kernel-syntax-examples/openapi_example/openapi_server.py b/python/samples/concepts/plugins/openapi/openapi_server.py similarity index 100% rename from python/samples/kernel-syntax-examples/openapi_example/openapi_server.py rename to python/samples/concepts/plugins/openapi/openapi_server.py diff --git a/python/samples/kernel-syntax-examples/plugins_from_dir.py b/python/samples/concepts/plugins/plugins_from_dir.py similarity index 100% rename from python/samples/kernel-syntax-examples/plugins_from_dir.py rename to python/samples/concepts/plugins/plugins_from_dir.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_api_handlebars.py b/python/samples/concepts/prompt_templates/azure_chat_gpt_api_handlebars.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_api_handlebars.py rename to python/samples/concepts/prompt_templates/azure_chat_gpt_api_handlebars.py diff --git a/python/samples/kernel-syntax-examples/azure_chat_gpt_api_jinja2.py b/python/samples/concepts/prompt_templates/azure_chat_gpt_api_jinja2.py similarity index 100% rename from python/samples/kernel-syntax-examples/azure_chat_gpt_api_jinja2.py rename to python/samples/concepts/prompt_templates/azure_chat_gpt_api_jinja2.py diff --git a/python/samples/kernel-syntax-examples/configuring_prompts.py b/python/samples/concepts/prompt_templates/configuring_prompts.py similarity index 100% rename from python/samples/kernel-syntax-examples/configuring_prompts.py rename to python/samples/concepts/prompt_templates/configuring_prompts.py diff --git a/python/samples/kernel-syntax-examples/load_yaml_prompt.py b/python/samples/concepts/prompt_templates/load_yaml_prompt.py similarity index 100% rename from python/samples/kernel-syntax-examples/load_yaml_prompt.py rename to python/samples/concepts/prompt_templates/load_yaml_prompt.py diff --git a/python/samples/kernel-syntax-examples/template_language.py b/python/samples/concepts/prompt_templates/template_language.py similarity index 100% rename from python/samples/kernel-syntax-examples/template_language.py rename to python/samples/concepts/prompt_templates/template_language.py diff --git a/python/samples/kernel-syntax-examples/rag_with_text_memory_plugin.py b/python/samples/concepts/rag/rag_with_text_memory_plugin.py similarity index 100% rename from python/samples/kernel-syntax-examples/rag_with_text_memory_plugin.py rename to python/samples/concepts/rag/rag_with_text_memory_plugin.py diff --git a/python/samples/kernel-syntax-examples/self-critique_rag.py b/python/samples/concepts/rag/self-critique_rag.py similarity index 100% rename from python/samples/kernel-syntax-examples/self-critique_rag.py rename to python/samples/concepts/rag/self-critique_rag.py diff --git a/python/samples/kernel-syntax-examples/resources/__init__.py b/python/samples/concepts/resources/__init__.py similarity index 100% rename from python/samples/kernel-syntax-examples/resources/__init__.py rename to python/samples/concepts/resources/__init__.py diff --git a/python/samples/kernel-syntax-examples/resources/email_plugin/native_function.py b/python/samples/concepts/resources/email_plugin/native_function.py similarity index 100% rename from python/samples/kernel-syntax-examples/resources/email_plugin/native_function.py rename to python/samples/concepts/resources/email_plugin/native_function.py diff --git a/python/samples/kernel-syntax-examples/resources/open_ai_plugins/akv-openai.json b/python/samples/concepts/resources/open_ai_plugins/akv-openai.json similarity index 100% rename from python/samples/kernel-syntax-examples/resources/open_ai_plugins/akv-openai.json rename to python/samples/concepts/resources/open_ai_plugins/akv-openai.json diff --git a/python/samples/kernel-syntax-examples/resources/open_ai_plugins/akv-openapi.yaml b/python/samples/concepts/resources/open_ai_plugins/akv-openapi.yaml similarity index 100% rename from python/samples/kernel-syntax-examples/resources/open_ai_plugins/akv-openapi.yaml rename to python/samples/concepts/resources/open_ai_plugins/akv-openapi.yaml diff --git a/python/samples/kernel-syntax-examples/resources/sample_plugins/generate_story.yaml b/python/samples/concepts/resources/sample_plugins/generate_story.yaml similarity index 100% rename from python/samples/kernel-syntax-examples/resources/sample_plugins/generate_story.yaml rename to python/samples/concepts/resources/sample_plugins/generate_story.yaml diff --git a/python/samples/kernel-syntax-examples/resources/sample_plugins/parrot.yaml b/python/samples/concepts/resources/sample_plugins/parrot.yaml similarity index 100% rename from python/samples/kernel-syntax-examples/resources/sample_plugins/parrot.yaml rename to python/samples/concepts/resources/sample_plugins/parrot.yaml diff --git a/python/samples/utils.py b/python/samples/concepts/resources/utils.py similarity index 100% rename from python/samples/utils.py rename to python/samples/concepts/resources/utils.py diff --git a/python/samples/kernel-syntax-examples/bing_plugin_examples.py b/python/samples/concepts/search/bing_plugin_examples.py similarity index 100% rename from python/samples/kernel-syntax-examples/bing_plugin_examples.py rename to python/samples/concepts/search/bing_plugin_examples.py diff --git a/python/samples/kernel-syntax-examples/bing_search_plugin.py b/python/samples/concepts/search/bing_search_plugin.py similarity index 100% rename from python/samples/kernel-syntax-examples/bing_search_plugin.py rename to python/samples/concepts/search/bing_search_plugin.py diff --git a/python/samples/kernel-syntax-examples/google_search_plugin.py b/python/samples/concepts/search/google_search_plugin.py similarity index 100% rename from python/samples/kernel-syntax-examples/google_search_plugin.py rename to python/samples/concepts/search/google_search_plugin.py diff --git a/python/samples/kernel-syntax-examples/google_palm_text_completion.py b/python/samples/concepts/text_generation/google_palm_text_completion.py similarity index 100% rename from python/samples/kernel-syntax-examples/google_palm_text_completion.py rename to python/samples/concepts/text_generation/google_palm_text_completion.py diff --git a/python/samples/demos/booking_restaurant/README.md b/python/samples/demos/booking_restaurant/README.md new file mode 100644 index 000000000000..88e31608df11 --- /dev/null +++ b/python/samples/demos/booking_restaurant/README.md @@ -0,0 +1,129 @@ +# Restaurant - Demo Application + +This sample provides a practical demonstration of how to leverage features from the [Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel) to build a console application. Specifically, the application utilizes the [Business Schedule and Booking API](https://www.microsoft.com/en-us/microsoft-365/business/scheduling-and-booking-app) through Microsoft Graph to enable a Large Language Model (LLM) to book restaurant appointments efficiently. This guide will walk you through the necessary steps to integrate these technologies seamlessly. + +## Prerequisites + +- Python 3.10, 3.11, or 3.12. +- [Microsoft 365 Business License](https://www.microsoft.com/en-us/microsoft-365/business/compare-all-microsoft-365-business-products) to use [Business Schedule and Booking API](https://www.microsoft.com/en-us/microsoft-365/business/scheduling-and-booking-app). +- [Azure Entra Id](https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id) administrator account to register an application and set the necessary credentials and permissions. + +### Function Calling Enabled Models + +This sample uses function calling capable models and has been tested with the following models: + +| Model type | Model name/id | Model version | Supported | +| --------------- | ------------------------- | ------------------: | --------- | +| Chat Completion | gpt-3.5-turbo | 0125 | ✅ | +| Chat Completion | gpt-3.5-turbo-1106 | 1106 | ✅ | +| Chat Completion | gpt-3.5-turbo-0613 | 0613 | ✅ | +| Chat Completion | gpt-3.5-turbo-0301 | 0301 | ❌ | +| Chat Completion | gpt-3.5-turbo-16k | 0613 | ✅ | +| Chat Completion | gpt-4 | 0613 | ✅ | +| Chat Completion | gpt-4-0613 | 0613 | ✅ | +| Chat Completion | gpt-4-0314 | 0314 | ❌ | +| Chat Completion | gpt-4-turbo | 2024-04-09 | ✅ | +| Chat Completion | gpt-4-turbo-2024-04-09 | 2024-04-09 | ✅ | +| Chat Completion | gpt-4-turbo-preview | 0125-preview | ✅ | +| Chat Completion | gpt-4-0125-preview | 0125-preview | ✅ | +| Chat Completion | gpt-4-vision-preview | 1106-vision-preview | ✅ | +| Chat Completion | gpt-4-1106-vision-preview | 1106-vision-preview | ✅ | + +ℹ️ OpenAI Models older than 0613 version do not support function calling. + +ℹ️ When using Azure OpenAI, ensure that the model name of your deployment matches any of the above supported models names. + +## Configuring the sample + +Please make sure your .env file contains the following: + +- "BOOKING_SAMPLE_CLIENT_ID" +- "BOOKING_SAMPLE_TENANT_ID" +- "BOOKING_SAMPLE_CLIENT_SECRET" + +### Create an App Registration in Azure Active Directory + +1. Go to the [Azure Portal](https://portal.azure.com/). +2. Select the Azure Active Directory service. +3. Select App registrations and click on New registration. +4. Fill in the required fields and click on Register. +5. Copy the Application **(client) Id** for later use. +6. Save Directory **(tenant) Id** for later use.. +7. Click on Certificates & secrets and create a new client secret. (Any name and expiration date will work) +8. Copy the **client secret** value for later use. +9. Click on API permissions and add the following permissions: + - Microsoft Graph + - Application permissions + - BookingsAppointment.ReadWrite.All + - Delegated permissions + - OpenId permissions + - offline_access + - profile + - openid + +### Create Or Use a Booking Service and Business + +1. Go to the [Bookings Homepage](https://outlook.office.com/bookings) website. +2. Create a new Booking Page and add a Service to the Booking (Skip if you don't ). +3. Access [Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer) +4. Run the following query to get the Booking Business Id: + ```http + GET https://graph.microsoft.com/v1.0/solutions/bookingBusinesses + ``` +5. Copy the **Booking Business Id** for later use. +6. Run the following query and replace it with your **Booking Business Id** to get the Booking Service Id + ```http + GET https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/{bookingBusiness-id}/services + ``` +7. Copy the **Booking Service Id** for later use. + +## Running the sample + +Either run the sample in an IDE, like VSCode, or via the command line. + +### Example of a conversation + +> **User** > Please book a restaurant for me. + +> **Assistant** > Sure, I can help you with that. Could you please provide me with the following information: +> +> 1. Name of the restaurant you would like to book. +> 2. Date and time of the reservation. +> 3. Number of people in your party. +> 4. Your name. +> 5. Your email address. +> 6. Your phone number. +> +> Once I have all this information, I will proceed with the booking. + +> **User** > I would like to book a table at the restaurant "The French Laundry" on the 15th of March at 7:00 PM for 4 people. My name is John Doe, my email address is john@internet.com, and my phone number is 123-456-7890. + +> **System** > Do you want to book a table at The French Laundry on 15/03/2023 19:00:00 for 4 people? + +> **System** > Please confirm by typing 'yes' or 'no'. + +> **User** > yes + +> **Assistant** > Great! I have successfully booked a table for you at "The French Laundry" on the 15th of March at 7:00 PM for 4 people. +> +> Your reservation has been made under the name John Doe. +> +> If you have any further questions or need to make any changes to your reservation, please let me know. + +> **User** > List my current bookings + +> **Assistant** > You currently have one booking: +> +> - Restaurant: The French Laundry +> - Date and Time: 15th of March at 7:00 PM +> - Party Size: 4 people +> +> If you need any further assistance or if there's anything else I can help you with, please let me know. + +> **User** > Cancel my booking + +> **System** > `[Cancelling a reservation for 4 at The French Laundry on 2023-03-15 at 19:00:00]` + +> **Assistant** > I have successfully canceled your booking at "The French Laundry" on the 15th of March at 7:00 PM for 4 people. +> +> If you have any other questions or need further assistance, please let me know. diff --git a/python/samples/kernel-syntax-examples/resources/bookings_plugin/__init__.py b/python/samples/demos/booking_restaurant/bookings_plugin/__init__.py similarity index 100% rename from python/samples/kernel-syntax-examples/resources/bookings_plugin/__init__.py rename to python/samples/demos/booking_restaurant/bookings_plugin/__init__.py diff --git a/python/samples/kernel-syntax-examples/resources/bookings_plugin/bookings_plugin.py b/python/samples/demos/booking_restaurant/bookings_plugin/bookings_plugin.py similarity index 84% rename from python/samples/kernel-syntax-examples/resources/bookings_plugin/bookings_plugin.py rename to python/samples/demos/booking_restaurant/bookings_plugin/bookings_plugin.py index 1b75c3d453ed..03602cabf73e 100644 --- a/python/samples/kernel-syntax-examples/resources/bookings_plugin/bookings_plugin.py +++ b/python/samples/demos/booking_restaurant/bookings_plugin/bookings_plugin.py @@ -63,6 +63,11 @@ async def book_table( Returns: str: The status of the booking. """ + print(f"System > Do you want to book a table at {restaurant} on {date_time} for {party_size} people?") + print("System > Please confirm by typing 'yes' or 'no'.") + confirmation = input("User:> ") + if confirmation.lower() != "yes": + return "Booking aborted by the user." request_body = BookingAppointment( odata_type="#microsoft.graph.bookingAppointment", customer_time_zone=self.customer_timezone, @@ -107,7 +112,7 @@ async def book_table( self.booking_business_id ).appointments.post(request_body) - return response.id + return f"Booking successful! Your reservation ID is {response.id}." @kernel_function(name="list_revervations", description="List all reservations") async def list_reservations(self) -> Annotated[str, "The list of reservations"]: @@ -126,26 +131,18 @@ async def list_reservations(self) -> Annotated[str, "The list of reservations"]: async def cancel_reservation( self, reservation_id: Annotated[str, "The ID of the reservation"], + restaurant: Annotated[str, "The name of the restaurant"], + date: Annotated[str, "The date of the reservation"], + time: Annotated[str, "The time of the reservation"], + party_size: Annotated[int, "The number of people in the party"], ) -> Annotated[str, "The cancellation status of the reservation"]: """Cancel a reservation.""" - # The graph API is throwing a 500 (instead of a 400), so commenting this out for now until we - # can understand how to get it working. - # Filed issue: https://github.com/microsoftgraph/msgraph-sdk-python/issues/659 - - # # First cancel the reservation - # request_body = CancelPostRequestBody( - # comment="Your appointment has been successfully cancelled. Please call us again.", - # ) - - # await self.graph_client.solutions.booking_businesses.by_booking_business_id( - # self.booking_business_id - # ).appointments.by_booking_appointment_id(reservation.id).cancel.post(request_body) - - # # Then delete the reservation - # _ = ( - # await self.graph_client.solutions.booking_businesses.by_booking_business_id(self.booking_business_id) - # .appointments.by_booking_appointment_id(reservation.id) - # .delete() - # ) - return "Reservation canceled!" + print(f"System > [Cancelling a reservation for {party_size} at {restaurant} on {date} at {time}]") + + _ = ( + await self.graph_client.solutions.booking_businesses.by_booking_business_id(self.booking_business_id) + .appointments.by_booking_appointment_id(reservation_id) + .delete() + ) + return "Cancellation successful!" diff --git a/python/samples/kernel-syntax-examples/restaurant_booking.py b/python/samples/demos/booking_restaurant/restaurant_booking.py similarity index 88% rename from python/samples/kernel-syntax-examples/restaurant_booking.py rename to python/samples/demos/booking_restaurant/restaurant_booking.py index 0f7895609a78..7ae5a51f54b8 100644 --- a/python/samples/kernel-syntax-examples/restaurant_booking.py +++ b/python/samples/demos/booking_restaurant/restaurant_booking.py @@ -3,9 +3,9 @@ import asyncio from azure.identity import ClientSecretCredential +from bookings_plugin.bookings_plugin import BookingsPlugin from dotenv import dotenv_values from msgraph import GraphServiceClient -from resources.bookings_plugin.bookings_plugin import BookingsPlugin from semantic_kernel.connectors.ai.chat_completion_client_base import ChatCompletionClientBase from semantic_kernel.connectors.ai.open_ai.prompt_execution_settings.open_ai_prompt_execution_settings import ( @@ -18,13 +18,6 @@ from semantic_kernel.kernel import Kernel from semantic_kernel.utils.settings import booking_sample_settings_from_dot_env_as_dict, openai_settings_from_dot_env -# To be able to run this sample, you must do the following: -# 1. Create an Microsoft Entra App ID and Client Secret in Azure Portal -# 2. Add the client ID, tenant ID, and client secret to a .env file in the root of the project -# using the following format: BOOKING_SAMPLE_CLIENT_ID="", BOOKING_SAMPLE_TENANT_ID="", -# BOOKING_SAMPLE_CLIENT_SECRET="". -# 3. Create a booking business ID and service ID and give the app permissions based on your App Id and secret. - kernel = Kernel() service_id = "open_ai" diff --git a/python/notebooks/.env.example b/python/samples/getting_started/.env.example similarity index 100% rename from python/notebooks/.env.example rename to python/samples/getting_started/.env.example diff --git a/python/notebooks/00-getting-started.ipynb b/python/samples/getting_started/00-getting-started.ipynb similarity index 100% rename from python/notebooks/00-getting-started.ipynb rename to python/samples/getting_started/00-getting-started.ipynb diff --git a/python/notebooks/01-basic-loading-the-kernel.ipynb b/python/samples/getting_started/01-basic-loading-the-kernel.ipynb similarity index 100% rename from python/notebooks/01-basic-loading-the-kernel.ipynb rename to python/samples/getting_started/01-basic-loading-the-kernel.ipynb diff --git a/python/notebooks/02-running-prompts-from-file.ipynb b/python/samples/getting_started/02-running-prompts-from-file.ipynb similarity index 100% rename from python/notebooks/02-running-prompts-from-file.ipynb rename to python/samples/getting_started/02-running-prompts-from-file.ipynb diff --git a/python/notebooks/03-prompt-function-inline.ipynb b/python/samples/getting_started/03-prompt-function-inline.ipynb similarity index 100% rename from python/notebooks/03-prompt-function-inline.ipynb rename to python/samples/getting_started/03-prompt-function-inline.ipynb diff --git a/python/notebooks/04-kernel-arguments-chat.ipynb b/python/samples/getting_started/04-kernel-arguments-chat.ipynb similarity index 100% rename from python/notebooks/04-kernel-arguments-chat.ipynb rename to python/samples/getting_started/04-kernel-arguments-chat.ipynb diff --git a/python/notebooks/05-using-the-planner.ipynb b/python/samples/getting_started/05-using-the-planner.ipynb similarity index 100% rename from python/notebooks/05-using-the-planner.ipynb rename to python/samples/getting_started/05-using-the-planner.ipynb diff --git a/python/notebooks/06-memory-and-embeddings.ipynb b/python/samples/getting_started/06-memory-and-embeddings.ipynb similarity index 100% rename from python/notebooks/06-memory-and-embeddings.ipynb rename to python/samples/getting_started/06-memory-and-embeddings.ipynb diff --git a/python/notebooks/07-hugging-face-for-plugins.ipynb b/python/samples/getting_started/07-hugging-face-for-plugins.ipynb similarity index 100% rename from python/notebooks/07-hugging-face-for-plugins.ipynb rename to python/samples/getting_started/07-hugging-face-for-plugins.ipynb diff --git a/python/notebooks/08-native-function-inline.ipynb b/python/samples/getting_started/08-native-function-inline.ipynb similarity index 100% rename from python/notebooks/08-native-function-inline.ipynb rename to python/samples/getting_started/08-native-function-inline.ipynb diff --git a/python/notebooks/09-groundedness-checking.ipynb b/python/samples/getting_started/09-groundedness-checking.ipynb similarity index 100% rename from python/notebooks/09-groundedness-checking.ipynb rename to python/samples/getting_started/09-groundedness-checking.ipynb diff --git a/python/notebooks/10-multiple-results-per-prompt.ipynb b/python/samples/getting_started/10-multiple-results-per-prompt.ipynb similarity index 100% rename from python/notebooks/10-multiple-results-per-prompt.ipynb rename to python/samples/getting_started/10-multiple-results-per-prompt.ipynb diff --git a/python/notebooks/11-streaming-completions.ipynb b/python/samples/getting_started/11-streaming-completions.ipynb similarity index 100% rename from python/notebooks/11-streaming-completions.ipynb rename to python/samples/getting_started/11-streaming-completions.ipynb diff --git a/python/notebooks/services.py b/python/samples/getting_started/services.py similarity index 100% rename from python/notebooks/services.py rename to python/samples/getting_started/services.py diff --git a/python/notebooks/third_party/.env.example b/python/samples/getting_started/third_party/.env.example similarity index 100% rename from python/notebooks/third_party/.env.example rename to python/samples/getting_started/third_party/.env.example diff --git a/python/notebooks/third_party/weaviate-persistent-memory.ipynb b/python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb similarity index 100% rename from python/notebooks/third_party/weaviate-persistent-memory.ipynb rename to python/samples/getting_started/third_party/weaviate-persistent-memory.ipynb diff --git a/python/samples/documentation_examples/.env.example b/python/samples/learn_resources/.env.example similarity index 100% rename from python/samples/documentation_examples/.env.example rename to python/samples/learn_resources/.env.example diff --git a/python/samples/documentation_examples/README.md b/python/samples/learn_resources/README.md similarity index 100% rename from python/samples/documentation_examples/README.md rename to python/samples/learn_resources/README.md diff --git a/python/samples/documentation_examples/ai_services.py b/python/samples/learn_resources/ai_services.py similarity index 100% rename from python/samples/documentation_examples/ai_services.py rename to python/samples/learn_resources/ai_services.py diff --git a/python/samples/documentation_examples/configuring_prompts.py b/python/samples/learn_resources/configuring_prompts.py similarity index 100% rename from python/samples/documentation_examples/configuring_prompts.py rename to python/samples/learn_resources/configuring_prompts.py diff --git a/python/samples/documentation_examples/creating_functions.py b/python/samples/learn_resources/creating_functions.py similarity index 100% rename from python/samples/documentation_examples/creating_functions.py rename to python/samples/learn_resources/creating_functions.py diff --git a/python/samples/documentation_examples/evaluate_with_prompt_flow.py b/python/samples/learn_resources/evaluate_with_prompt_flow.py similarity index 100% rename from python/samples/documentation_examples/evaluate_with_prompt_flow.py rename to python/samples/learn_resources/evaluate_with_prompt_flow.py diff --git a/python/samples/documentation_examples/functions_within_prompts.py b/python/samples/learn_resources/functions_within_prompts.py similarity index 100% rename from python/samples/documentation_examples/functions_within_prompts.py rename to python/samples/learn_resources/functions_within_prompts.py diff --git a/python/samples/documentation_examples/improved_evaluate_with_prompt_flow.py b/python/samples/learn_resources/improved_evaluate_with_prompt_flow.py similarity index 100% rename from python/samples/documentation_examples/improved_evaluate_with_prompt_flow.py rename to python/samples/learn_resources/improved_evaluate_with_prompt_flow.py diff --git a/python/samples/documentation_examples/planner.py b/python/samples/learn_resources/planner.py similarity index 100% rename from python/samples/documentation_examples/planner.py rename to python/samples/learn_resources/planner.py diff --git a/python/samples/documentation_examples/plugin.py b/python/samples/learn_resources/plugin.py similarity index 100% rename from python/samples/documentation_examples/plugin.py rename to python/samples/learn_resources/plugin.py diff --git a/python/samples/documentation_examples/plugins/MathPlugin/native_function.py b/python/samples/learn_resources/plugins/MathPlugin/native_function.py similarity index 100% rename from python/samples/documentation_examples/plugins/MathPlugin/native_function.py rename to python/samples/learn_resources/plugins/MathPlugin/native_function.py diff --git a/python/samples/documentation_examples/plugins/OrchestratorPlugin/GetIntent/config.json b/python/samples/learn_resources/plugins/OrchestratorPlugin/GetIntent/config.json similarity index 100% rename from python/samples/documentation_examples/plugins/OrchestratorPlugin/GetIntent/config.json rename to python/samples/learn_resources/plugins/OrchestratorPlugin/GetIntent/config.json diff --git a/python/samples/documentation_examples/plugins/OrchestratorPlugin/GetIntent/skprompt.txt b/python/samples/learn_resources/plugins/OrchestratorPlugin/GetIntent/skprompt.txt similarity index 100% rename from python/samples/documentation_examples/plugins/OrchestratorPlugin/GetIntent/skprompt.txt rename to python/samples/learn_resources/plugins/OrchestratorPlugin/GetIntent/skprompt.txt diff --git a/python/samples/documentation_examples/plugins/WriterPlugin/ShortPoem/config.json b/python/samples/learn_resources/plugins/WriterPlugin/ShortPoem/config.json similarity index 100% rename from python/samples/documentation_examples/plugins/WriterPlugin/ShortPoem/config.json rename to python/samples/learn_resources/plugins/WriterPlugin/ShortPoem/config.json diff --git a/samples/plugins/WriterPlugin/ShortPoem/skprompt.txt b/python/samples/learn_resources/plugins/WriterPlugin/ShortPoem/skprompt.txt similarity index 100% rename from samples/plugins/WriterPlugin/ShortPoem/skprompt.txt rename to python/samples/learn_resources/plugins/WriterPlugin/ShortPoem/skprompt.txt diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/.promptflow/flow.layout.json b/python/samples/learn_resources/plugins/prompt_flow_helpers/.promptflow/flow.layout.json similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/.promptflow/flow.layout.json rename to python/samples/learn_resources/plugins/prompt_flow_helpers/.promptflow/flow.layout.json diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/.gitignore b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/.gitignore similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/.gitignore rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/.gitignore diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/.promptflow/flow.tools.json b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/.promptflow/flow.tools.json similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/.promptflow/flow.tools.json rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/.promptflow/flow.tools.json diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/data.jsonl b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/data.jsonl similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/data.jsonl rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/data.jsonl diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/flow.dag.yaml b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/flow.dag.yaml similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/flow.dag.yaml rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/flow.dag.yaml diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/math_planner.py b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/math_planner.py similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/math_planner.py rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/math_planner.py diff --git a/python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/plugins/MathPlugin/Math.py b/python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/plugins/MathPlugin/Math.py similarity index 100% rename from python/samples/documentation_examples/plugins/prompt_flow_helpers/perform_math/plugins/MathPlugin/Math.py rename to python/samples/learn_resources/plugins/prompt_flow_helpers/perform_math/plugins/MathPlugin/Math.py diff --git a/python/samples/documentation_examples/plugins/prompts/chat/config.json b/python/samples/learn_resources/plugins/prompts/chat/config.json similarity index 100% rename from python/samples/documentation_examples/plugins/prompts/chat/config.json rename to python/samples/learn_resources/plugins/prompts/chat/config.json diff --git a/python/samples/documentation_examples/plugins/prompts/chat/skprompt.txt b/python/samples/learn_resources/plugins/prompts/chat/skprompt.txt similarity index 100% rename from python/samples/documentation_examples/plugins/prompts/chat/skprompt.txt rename to python/samples/learn_resources/plugins/prompts/chat/skprompt.txt diff --git a/python/samples/documentation_examples/prompts.py b/python/samples/learn_resources/prompts.py similarity index 100% rename from python/samples/documentation_examples/prompts.py rename to python/samples/learn_resources/prompts.py diff --git a/python/samples/documentation_examples/serializing_prompts.py b/python/samples/learn_resources/serializing_prompts.py similarity index 100% rename from python/samples/documentation_examples/serializing_prompts.py rename to python/samples/learn_resources/serializing_prompts.py diff --git a/python/samples/documentation_examples/service_configurator.py b/python/samples/learn_resources/service_configurator.py similarity index 100% rename from python/samples/documentation_examples/service_configurator.py rename to python/samples/learn_resources/service_configurator.py diff --git a/python/samples/documentation_examples/templates.py b/python/samples/learn_resources/templates.py similarity index 100% rename from python/samples/documentation_examples/templates.py rename to python/samples/learn_resources/templates.py diff --git a/python/samples/documentation_examples/using_the_kernel.py b/python/samples/learn_resources/using_the_kernel.py similarity index 100% rename from python/samples/documentation_examples/using_the_kernel.py rename to python/samples/learn_resources/using_the_kernel.py