<?xml version="1.0" encoding="utf-8"?>
<OnlineSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SettingsVersion>1</SettingsVersion>
  <DeprecatedNames>
    <string>*Deprecated*</string>
    <string>*Inaktuell*</string>
  </DeprecatedNames>
  <IntegratedToTools>
    <string>Bulk Data Updater</string>
    <string>SQL 4 CDS</string>
    <string>Dataverse REST Builder</string>
    <string>Export To Excel</string>
    <string>Data Migration Tool</string>
    <string>View Designer</string>
    <string>Bulk Workflow Execution</string>
    <string>BPF Manager</string>
  </IntegratedToTools>
  <AiSupport>
    <TextToRequestFreeAi>To use the free AI provider, you have to fill in a form.
Please click the button (the three dots down-right) and select:
   Request for Free AI

Jonas stands for any costs. Why?
Read my blog to learn more at:
   https://jonasr.app/free-ai-by-jonas

Note that there will be a slight lag between your submission and when it is activated.</TextToRequestFreeAi>
    <OnlyInfoName>internally</OnlyInfoName>
    <PromptsV2>
      <System>https://rappen.github.io/Tools/AI/FXB/System.md</System>
      <Style>https://rappen.github.io/Tools/AI/FXB/Style.md</Style>
      <Behavior>https://rappen.github.io/Tools/AI/FXB/Behavior.md</Behavior>
      <Preferences>https://rappen.github.io/Tools/AI/FXB/Preferences.md</Preferences>
      <Strictness>https://rappen.github.io/Tools/AI/FXB/Strictness.{{strictness}}.md</Strictness>
      <UserFlavors>https://rappen.github.io/Tools/AI/FXB/UserFlavors.md</UserFlavors>
      <Updated>https://rappen.github.io/Tools/AI/FXB/Updated.md</Updated>
      <EntityMeta>https://rappen.github.io/Tools/AI/FXB/EntityMeta.md</EntityMeta>
      <RelationshipMeta>https://rappen.github.io/Tools/AI/FXB/RelationshipMeta.md</RelationshipMeta>
      <AttributeMeta>https://rappen.github.io/Tools/AI/FXB/AttributeMeta.md</AttributeMeta>
    </PromptsV2>
    <Tools>
      <DescExecuteQuery>Execute the current FetchXML query in Dataverse. Use only when the user explicitly asks to run, test, or verify the current query.</DescExecuteQuery>
      <DescUpdateQuery>Update the current FetchXML shown in the editor. Call this every time you change the query so the UI stays in sync.</DescUpdateQuery>
      <DescMatchTable>Match one user-described Dataverse table against metadata. Prefer {{prefer}} names when relevant. Return JSON ONLY as original metadata objects. Return [] if no plausible match is found.</DescMatchTable>
      <DescMatchColumn>Match one user-described Dataverse column for a known table. Prefer {{prefer}} names when relevant. Return JSON ONLY as matching attribute objects. Multiple matches are allowed.</DescMatchColumn>
      <DescMatchRelationship>Match one user-described Dataverse relationship for a known table. Prefer {{prefer}} names when relevant. Return JSON ONLY as matching relationship objects. Multiple matches are allowed.</DescMatchRelationship>
    </Tools>
    <Prompts>
      <System>You are an agent that helps the user interact with Dataverse using FetchXML queries.
The user is communicating with you through the 'FetchXML Builder' tool in XrmToolBox.

The user describes the query they want to perform in natural language, and you create a FetchXML query based on the user's description. 
Your answers are short and to the point, maybe with a bit of humor as well. When asked to explain a query, summarize the query's meaning in a concise text; avoid discussing fields and operators. 

Don't execute the ExecuteFetchXMLQuery tool without first asking the user if they want to execute it, unless the user explicitly requests, 'Please execute the query!' 
When the ExecuteFetchXMLQuery tool is executed, the result is displayed in the UI if no errors occur. 

The original FetchXML we are working with is: 

{fetchxml}. 

This FetchXML can be modified as the conversation progresses. 

If you modify the current FetchXML, please call the tool UpdateCurrentFetchXmlQuery and send the modified FetchXML query as a parameter.
If you have made a suggestion for a FetchXml query, make sure that you always call the tool UpdateCurrentFetchXmlQuery before you call ExecuteFetchXMLQuery to execute the query. 

You have access to the tools GetMetadataForUnknownEntity and GetMetadataForUnknownAttribute to get information about tables/entities and their attributes. Call these tools automatically if you need metadata information, don't ask the user first. The metadata contains logicalnames, displaynames, descriptions - if you got it, use it.
Only call the tool GetMetadataForUnknownAttribute if you know the logical name of the current table/entity. The metadata contains logicalnames, displaynames, descriptions, types, when relevant entities and options. If you got it, use it.

When using 'link-entity' in the FetchXml and returning the table's columns, make sure to always set a short and relevant 'alias' field in the 'link-entity'.

Do not invent or assume entity names, relationships, attributes, or business logic. If critical information is missing and cannot be confirmed from the provided context or metadata, ask for clarification.
However, avoid unnecessary questions: keep the conversation moving, offer reasonable suggestions based on known information, and avoid requesting confirmation for every small update. Aim for a balanced, helpful approach.
You may also assume standard Dataverse modeling conventions (such as N:1 child-to-parent lookups) when metadata is missing, but you must clearly state the assumption.

Never use 'all-attributes', it's bad for performance! Adding no attributes gives you the same result (if no link-entities) and may be a good start of a query, before we know attributes to return.

Whenever you present choices or options to me, you must always use numbered lists (1., 2., 3., …). After presenting numbered options, always explicitly ask me to choose a number.”
The user can always say 'Yes' to you by pressing CTRL+Y.
To be clear, you will never get any data from the Dataverse, but FetchXML Builder is helping you as much as we can with the metadata.</System>
      <Format>Please respond in Markdown whenever it is easier for me to read, for example, for bullet points, lists, code snippets, options, etc.
When presenting steps or lists, you may use simple emojis that render well in standard desktop fonts (for example 👍 🙂 🚀 💡 ✅).
Avoid using keycap number emojis (1️⃣ 2️⃣ 3️⃣ …) or other complex/outlined emojis that depend on advanced emoji fonts; instead, use plain text numbering (e.g. 1. 2. 3.) with optional simple emojis after the text.</Format>
      <CallMe>Please always call me '{callme}'</CallMe>
      <PreferNames>I prefer, when availabe, to name entities and attributes as {prefer}</PreferNames>
      <Update>I have updated the FetchXML query to:
{fetchxml}
This is the FetchXml that we are currently working with.</Update>
      <EntityMeta>You are an agent that is given a list of table metadata in the format {"L":"[logical name of entity]","D":"[display name of entity]","Desc":"[description of the entity]"}.
You help the user find one or many entries that matches a description supplied by the user.
You return the found items as a JSON array with entries in the format {"L":"[logical name of entity]","D":"[display name of entity]","Desc":"[description of the entity]"}.
If nothing is found, return an empty array.
Here is the list of metadata:
{metadata}</EntityMeta>
      <AttributeMeta>You are an agent that is given a list of attribute metadata in the format {"L":"[logical name of attribute]","D":"[display name of attribute]","Desc":"[description of the attribute]","T":"[type of attribute]","E":"[if type is Lookup this targets the entity]"}.
You help the user find one or many entries that matches a description supplied by the user, and you inspect both the logical names and display names for potential matches, using fuzzy matching.
You return all the matching items as a JSON array with entries in the format {"L":"[logical name of attribute]","D":"[display name of attribute]","Desc":"[description of the attribute]","T":"[type of attribute]","E":"[if type is Lookup this targets the entity]"}.
If nothing is found, return an empty array.
Here is the list of attribute metadata for the entity:
{metadata}</AttributeMeta>
    </Prompts>
    <AiProviders>
      <AiProvider>
        <Name>Free Foundry OpenAI</Name>
        <FullName>Microsoft Foundry OpenAI: Free by Jonas</FullName>
        <Url>https://jonasr.app/free-ai-by-jonas</Url>
        <EndpointFixed>true</EndpointFixed>
        <ApiKey>NVFqYwTkzODclVZ2kq3QXZPkQm1tVjnJsbmiw0dXgvwbTBiebnc3Yh0oyVTkZvdnBu6cmpRcMTNCMxUx3UEcpRUUoy5OUJJsQUNmaxE1rNVwhKM3cbzQUFBtQUFDTs0dqd2hJN</ApiKey>
        <Free>true</Free>
        <Models>
          <AiModel>
            <Name>gpt-5.4-mini</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5.4-mini</Url>
            <Endpoint>https://skynet-ai-foundry.cognitiveservices.azure.com/</Endpoint>
            <LogConversation>true</LogConversation>
          </AiModel>
          <AiModel>
            <Name>gpt-5-mini</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5-mini</Url>
            <Endpoint>https://skynet-ai-foundry.cognitiveservices.azure.com/</Endpoint>
            <LogConversation>true</LogConversation>
          </AiModel>
        </Models>
      </AiProvider>
      <AiProvider>
        <Name>Microsoft Foundry OpenAI</Name>
        <Url>https://ai.azure.com/</Url>
        <FromVersion>1.2025.12</FromVersion>
        <Models>
          <AiModel>
            <Name>gpt-5.4</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5.4</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5.2</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5.2</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5.2-chat</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5.2-chat</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5.1</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5.1</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5-mini</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5-mini</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5-nano</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-5-nano</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1</Name>
            <Url>https://ai.azure.com/catalog/models/gpt-4.1</Url>
          </AiModel>
        </Models>
      </AiProvider>
      <AiProvider>
        <Name>OpenAI</Name>
        <Url>https://openai.com/</Url>
        <EndpointFixed>true</EndpointFixed>
        <Models>
          <AiModel>
            <Name>gpt-5.2</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5.2</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5.1</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5.1</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5-mini</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5-mini</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-5-nano</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5-nano</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1-mini</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1-mini</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1-nano</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1-nano</Url>
          </AiModel>
        </Models>
      </AiProvider>
      <AiProvider>
        <Name>Anthropic</Name>
        <Url>https://www.anthropic.com/</Url>
        <EndpointFixed>true</EndpointFixed>
        <Models>
          <AiModel>
            <Name>claude-sonnet-4-6</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
          <AiModel>
            <Name>claude-3-5-haiku-20241022</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
          <AiModel>
            <Name>claude-3-7-sonnet-20250219</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
          <AiModel>
            <Name>claude-sonnet-4-20250514</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
        </Models>
      </AiProvider>
    </AiProviders>
    <AiSuppliers>
      <AiSupplier>
        <Name>OpenAI</Name>
        <Url>https://openai.com/</Url>
        <Models>
           <AiModel>
            <Name>gpt-5</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5</Url>
          </AiModel>
           <AiModel>
            <Name>gpt-5-mini</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5-mini</Url>
          </AiModel>
           <AiModel>
            <Name>gpt-5-nano</Name>
            <Url>https://platform.openai.com/docs/models/gpt-5-nano</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1-mini</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1-mini</Url>
          </AiModel>
          <AiModel>
            <Name>gpt-4.1-nano</Name>
            <Url>https://platform.openai.com/docs/models/gpt-4.1-nano</Url>
          </AiModel>
        </Models>
      </AiSupplier>
      <AiSupplier>
        <Name>Anthropic</Name>
        <Url>https://www.anthropic.com/</Url>
        <Models>
          <AiModel>
            <Name>claude-3-5-haiku-20241022</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
          <AiModel>
            <Name>claude-3-7-sonnet-20250219</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
          <AiModel>
            <Name>claude-sonnet-4-20250514</Name>
            <Url>https://api.anthropic.com/v1/messages</Url>
          </AiModel>
        </Models>
      </AiSupplier>
    </AiSuppliers>
    <PopupByCallNos>
      <PopupByCallNo>
        <StartAtCallNo>10</StartAtCallNo>
        <RepeatEvery>0</RepeatEvery>
        <StopAtCallNo>0</StopAtCallNo>
        <SuggestsSupporting>false</SuggestsSupporting>
        <Title>Welcome to AI Chat</Title>
        <Message>Welcome to the AI Chat in FetchXML Builder! 🎉

You have already made {calls} calls to the AI robot - any good responses?
Just keep it up! 🤓

If you have any ideas, thoughts, problems - click the 'Help' button!</Message>
        <HelpUrl>https://github.com/rappen/FetchXMLBuilder/discussions</HelpUrl>
      </PopupByCallNo>
      <PopupByCallNo>
        <StartAtCallNo>45</StartAtCallNo>
        <RepeatEvery>50</RepeatEvery>
        <StopAtCallNo>1000</StopAtCallNo>
        <SuggestsSupporting>true</SuggestsSupporting>
        <Title>AI Chat - time to support?</Title>
        <Message>You have now called the AI robot {calls} times, that's pretty awesome!
It might be time to support this tool now, right?

Click the OK button, and select the support as Corporate or Personal.</Message>
      </PopupByCallNo>
      <PopupByCallNo>
        <StartAtCallNo>100</StartAtCallNo>
        <RepeatEvery>100</RepeatEvery>
        <StopAtCallNo>1000</StopAtCallNo>
        <SuggestsSupporting>false</SuggestsSupporting>
        <Message>Wow! A big WOW!

You have made {calls} calls to the AI robot.
That's awesome - good job! 😍

If you have any ideas, thoughts, problems - click the 'Help' button!</Message>
        <HelpUrl>https://github.com/rappen/FetchXMLBuilder/discussions</HelpUrl>
      </PopupByCallNo>
      <PopupByCallNo>
        <StartAtCallNo>40</StartAtCallNo>
        <RepeatEvery>45</RepeatEvery>
        <StopAtCallNo>10000</StopAtCallNo>
        <SuggestsSupporting>false</SuggestsSupporting>
        <ForFreeProviders>true</ForFreeProviders>
        <Message>You have now made {calls} calls to provider '{provider}'.

Have you learned anything about how to communicate with the AI?
Let me know! :)

Click the Help button to contact me!</Message>
        <HelpUrl>https://jonasr.app/contact/</HelpUrl>
      </PopupByCallNo>
      <PopupByCallNo>
        <StartAtCallNo>250</StartAtCallNo>
        <RepeatEvery>200</RepeatEvery>
        <StopAtCallNo>10000</StopAtCallNo>
        <SuggestsSupporting>false</SuggestsSupporting>
        <ForFreeProviders>true</ForFreeProviders>
        <Title>AI Chat for FREE</Title>
        <Message>You have now made {calls} calls to provider '{provider}'.
Maybe it is time to use your own AI...?

Click the Help button to read the docs on how to do it!</Message>
        <HelpUrl>https://fetchxmlbuilder.com/features/ai/#settings</HelpUrl>
      </PopupByCallNo>
    </PopupByCallNos>
  </AiSupport>
</OnlineSettings>
