Forum Discussion

DennesTorres's avatar
DennesTorres
Power Participant
2 years ago
Solved

Semantic Model in Fabric

Hi, This article is very interesting: https://blog.fabric.microsoft.com/en-us/blog/chat-your-data-in-microsoft-fabric-with-semantic-kernel/ but, how is exposed in one of the comments, in no mom...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi DennesTorres ,

    The article is a "getting started" article, and I think you are expecting to find the recipe for perfect Data Copilot inside.
    The article seems primarily intended to demonstrate how to install SK in our Python environment and how to use it (with a small example). Or, essentially, how one can start to build, almost from scratch, a chat model over one's data, in Fabric. The article does not claim to build the best possible copilot.
    You are right, the mini-chat tool demonstrated in the article can be extended to make the GPT system aware of the data model. For this, the you should follow this:

    1) Explore the lakehouse structure (either using standard Python code, or the new Semantic Link library in Fabric).
    2) Pass the lakehouse structure information to the GPT model as part of the Semantic Kernel prompt .
    Please refer this document for more information:  How to write prompts in Semantic Kernel.

    Hope this helps. Please let me know if you have any further queries.

  • DennesTorres's avatar
    DennesTorres
    2 years ago

    Hi,

    Thank you, I end up discovering the missing points.

    The trick is on the semantic model skills. The skills are System Prompts which define what answer the LLM will provide. We can provide an entire explanation of our model on the skill, allowing the LLM to query our entire model. 

    The entire problem becomes a problem of prompt engineering.

    However, it's important to change the JSON as well. The default JSON which comes with the skills has a max_tokens parameter of 16000. This is the maximum for the response, which means the system prompt can have only 384 (more or less). 

    I doubt any SQL statement will reach 16000 caracters, so it can be reduced to 5000 for example, giving us a good space to explain our model to the LLM.

    Kind Regards,

    Dennes