-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form10.cs
44 lines (37 loc) · 1.23 KB
/
Form10.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Azure.AI.OpenAI;
namespace CalculoFormsApp
{
public partial class Form10 : Form
{
OpenAIClient client = new OpenAIClient("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");
public Form10()
{
InitializeComponent();
}
private void Form10_Load(object sender, EventArgs e)
{
}
private async void BtnEcSimplify_Click(object sender, EventArgs e)
{
CompletionsOptions options = new CompletionsOptions();
options.DeploymentName = "gpt-3.5-turbo-instruct-0914";
options.Prompts.Add("Resuelve el siguiente problema usando técnicas de conteo. Solo dame fórmula y resultado. " + EcTextBox.Text);
options.MaxTokens = 100;
options.Temperature = 1;
var openAiResponse = await client.GetCompletionsAsync(options);
foreach (var choice in openAiResponse.Value.Choices)
{
AnswerLabel.Text = choice.Text;
}
}
}
}