Skip to content

Instantly share code, notes, and snippets.

View dhinag's full-sized avatar

Dhina dhinag

View GitHub Profile
@dhinag
dhinag / Greet user
Last active January 16, 2020 22:26
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html,
body {
height: 100%;
}
styleOptions: {
backgroundColor: 'rgba(255, 255, 255, .8)',
bubbleBackground: 'rgba(0, 0, 255, .1)',
bubbleFromUserBackground: 'rgba(0, 255, 0, .1)'
}
// Invoked when a conversation update activity is received from the external Azure Bot Service channel
// Start a Power Virtual Agents bot conversation and store the mapping
protected override async Task OnConversationUpdateActivityAsync(ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
AddConversationReference(turnContext.Activity as Bot.Schema.Activity);
await s_conversationManager.GetOrCreateBotConversationAsync(turnContext.Activity.Conversation.Id, _botService);
}
private void AddConversationReference(Bot.Schema.Activity activity)
{
//This action is called by the Power Automate
[HttpPost]
[Route("postReview")]
public async Task<IActionResult> PostReview(string activityId, string botId, string conversationId, string serviceUrl, string userId, string channelId, string botName)
{
var convRef = new ConversationReference();
//Revive the conversation reference
convRef.ActivityId = activityId;
convRef.Bot = new ChannelAccount { Id = botId, Name = botName };
import argparse
from langchain.agents import initialize_agent
from langchain.llms import OpenAI
import json
from langchain.agents import Tool
from flask import Flask
from flask_cors import CORS
from flask import *
import json, time