ModernWeb
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 《運用Semantic Kernel SDK 駕馭生成式AI應用的提示工程(Prompt Engineering)》 / 陳葵懋 (Ian Chen) {%hackmd @ModernWeb/SyA2U6SmT %} > 共筆請從這開始 ## Generative AI - Prompt gpt 4 turbo 幻覺比較少 ### Good Prompt - 具體明確:明確表達你想要詢問的問題或希望進行的討論。幫助模型理解你的需求。 - 簡潔直接:prompt本身應該避免冗長和不必要的廢話。 - 避免歧義:使用清晰的語言避免多義性或模稜兩可的表達。 - 拆解任務:step by step 的引導,會比一次性問好問滿來得有效。 ### If we want to develop our own ChatGPT - 使用者介面: - command -> prompt - prompt engineering - LLM 的挑戰: - 通用知識的更新 - 推理的挑戰性 不擅長推理,需要使用 prompt 技巧 - 私有知識的學習 不能期待每個使用者都具有良好的 prompt 技巧,於是在應用中開發者可以調整使用者輸入的 prompt 並調整為更適合 GPT 接收的 prompt - 開發層面的挑戰: - 將 Prompt 融入程式碼(面向語義的開發) - 不同應用場景,prompt的內容也需要改變。沒有一個prompt是萬能的 - 外接企業私有資源庫 - 整合外部服務 - 長短期記憶/檢索(使用向量資料庫精準搜尋)。模型本身沒有記憶能力,之前都是一來一往的,GPT 現在可以幫你記憶了 - 面向不同的GPT模型(圖像生成, 文字生成, 程式碼生成...) ## Semantic kernel overview - Open source SDK - Use common LLM AI coding pattern - Use pre-build plugins and connectors - Cross multiple models 1. models and memory 2. connectors 3. semantic kernel 4. plugins:幫模型裝上外掛武器,讓他具備比較特殊的能力。 5. triggers and actions ![image.png](https://hackmd.io/_uploads/B1Gu6-qm6.png) ### The Semantic Kernel modules - Kernel:semantic kernel的核心組件 - Plugins:一或多個能力的集合。直白來說就是寫好的function,writerplugin: - translate - gen email - style rewrite - Connectors:連接外部資源或服務 - Bing Search - Google Search - Planner:根據目標(goal),建立工作流程對其進行操作,執行計畫是一連傳 function 的組合,進而產生結果 - Memory: - 記憶Semantic memory, localstorage 實現長短期記憶能力 - embedding #### Semantic Kernel - Plugins 在Plugin裡面有兩種 **Semantic Function** semantic function用語意的方式去驅動chatGPT,一切透過文字的方式產生 依賴prompt **Native Function** 以程式語言建構而成,用於提供LLM模型本身無法具備的能力。 ex: 模型本身沒有時間,只能透過程式回答 所有得一切源自於提問 ![image.png](https://hackmd.io/_uploads/Hyhv1McXp.png) ## Demo ### write email 透過semantic function去呼叫native function ### Sequential Planner 他會依照我賦予他的能力,完成我的目標 ### Retrieval Augmented Generation 檢索增強生成 因為模型本身沒有我的data,想請他參考後生成最後的內容 user->prompt(question, vector storage -> context)->LLM api endpoint -> 未完 demo:把發問的韓文翻譯成中文去跟我向量資料庫比對後找到相對的中文後再翻譯成韓文回傳給使用者 https://github.com/iangithub/sklearn/tree/main/MWC-2023 ------ > 聊天室在此 人有點少? > 我說線上的 想請教各位會擔心將source code提供給ChatGPT,是否會擔心source code流出? > 被參考是code寫得好 > 公司才會擔心?商業模式的部分吧 >> 資安的問題? >>>確實會擔心商業模式流出 感謝貼圖的大大 > 好奇圖哪裡來的 谷歌關鍵字 https://ithelp.ithome.com.tw/users/20126569/ironman/6022 講師的鐵人賽 > cool > 33頁,講得完嗎 > > 有提供 ppt 一切好說(X > 是我的錯覺還是我只有看到餵完 openAI 的 output > 我比較想看出經過 SK 後的 prompt 長相 > > 是可以的,只是今天沒安排demo這一段 > > > 喔喔,感恩~ > 今天的簡報 : https://www.canva.com/design/DAFzd2buj8M/4wmEWbRGLVY_M_T0f2kADQ/edit?utm_content=DAFzd2buj8M&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton >

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully