> For the complete documentation index, see [llms.txt](https://docs.mluvii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mluvii.com/pro-it-specialisty/napojeni-chatbotu/microsoft-bot-framework.md).

# Microsoft Bot Framework

## Ukázková implementace

Na Githubu je k dispozici [příklad implementace bota s integrací na mluvii](https://github.com/mluvii/mluviibot)

## Podporované formáty Microsoft Hero Cards

V tuto chvíli mluvii podporuje následující funkcionality karet [Hero Card](https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-add-rich-card-attachments?view=azure-bot-service-3.0):&#x20;

**Typ hero karty (contentType):**

* application/vnd.microsoft.card.hero
* application/vnd.microsoft.card.thumbnail

**Rozložení přiloh (AttachmentLayout):**

* List
* Carousel

Chat input vlastnosti:

* [Vstupní rady](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-add-input-hints?view=azure-bot-service-4.0)
* [Navrhované akce](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-add-suggested-actions?view=azure-bot-service-3.0) typu [imBack](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-add-rich-cards?view=azure-bot-service-3.0#process-events-within-rich-cards)

## Integrace s mluvii

Chatbot vytvořený v [Microsoft Bot Framework](https://dev.botframework.com) může s mluvii komunikovat pomocí [ChannelData](https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-channeldata). Může tak například vypsat seznam dostupných operátorů nebo odeslat email od klienta.

### Přiklad odeslání požadavku

```
private async Task ConnectToOperator(IDialogContext context)
  {
      var data = JObject.Parse(@"{ ""Activity"": ""Forward"" }");
      var act = context.MakeMessage();
      act.ChannelData = data;
      await context.PostAsync(act);
  }
```

### Přiklad přijetí odpovědi

```
private async Task OnMessageRecieved(IDialogContext context, IAwaitable<IMessageActivity> result)
  {
      var activity = await result;
      if (activity.AsEventActivity() != null && activity.ChannelData != null)
      {
          var availibleOperatorsInfo =
              JsonConvert.DeserializeObject<GetAvailableOperatorsResponse>(activity.ChannelData);
          await OnAvailibleOperatorsResponse(context, availibleOperatorsInfo);
      }
  }
```

### Identifikace kanálu mluvii

Při komunikaci s botem, se mluvii identifikuje pomocí konstantního Id *mluvii\_guest* v poli `From`. Např:

```json
"channelId": "directline"
...
"from": {
    "id": "mluvii_guest"
}
...
"conversation": {
```

## Next steps

[Zkontrolujte podporované aktivity](/pro-it-specialisty/napojeni-chatbotu/podporovane-aktivity.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mluvii.com/pro-it-specialisty/napojeni-chatbotu/microsoft-bot-framework.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
