This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var azureClient = new AzureOpenAIClient(new Uri(endpoint), new ApiKeyCredential(key)); | |
OpenAIFileClient fileClient = azureClient.GetOpenAIFileClient(); | |
AssistantClient assistantClient = azureClient.GetAssistantClient(); | |
OpenAIFile infoFile = await fileClient.UploadFileAsync("C:\\Users\\vardh\\Documents\\Customers.xlsx", FileUploadPurpose.Assistants); | |
AssistantCreationOptions assistantOptions = new() | |
{ | |
Name = "CodeInterpreterProMAX", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var azureClient = new AzureOpenAIClient(new Uri(endpoint), new ApiKeyCredential(key)); | |
OpenAIFileClient fileClient = azureClient.GetOpenAIFileClient(); | |
AssistantClient assistantClient = azureClient.GetAssistantClient(); | |
OpenAIFile infoFile = await fileClient.UploadFileAsync("C:\\Customers.xlsx", FileUploadPurpose.Assistants); | |
AssistantCreationOptions assistantOptions = new() | |
{ | |
Name = "CodeInterpreterProMAX", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "https://<myopenaiservice>.openai.azure.com/"; | |
string key = "<my-open-ai-service-key>"; | |
string deploymentName = "gpt-4o"; | |
var azureClient = new AzureOpenAIClient(new Uri(endpoint), new ApiKeyCredential(key)); | |
OpenAIFileClient fileClient = azureClient.GetOpenAIFileClient(); | |
AssistantClient assistantClient = azureClient.GetAssistantClient(); | |
VectorStoreClient vectorClient = azureClient.GetVectorStoreClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "https://<myopenaiservice>.openai.azure.com/"; | |
string key = "<my-open-ai-service-key>"; | |
string deploymentName = "gpt-4o"; | |
//We are using the Azure OpenAI Service so create an Azure OpenAI client | |
var azureClient = new AzureOpenAIClient(new Uri(endpoint), new ApiKeyCredential(key)); | |
AssistantClient assistantClient = azureClient.GetAssistantClient(); | |
//Create assistant | |
AssistantCreationOptions assistantOptions = new() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chatClient = openAiClient.GetChatClient(deploymentName); | |
List<ChatMessage> messages = [ | |
new UserChatMessage( | |
ChatMessageContentPart.CreateImageMessageContentPart( | |
new Uri("https://dalleprodsec.blob.core.windows.net/private/images/generated_00.png"), | |
ImageChatMessageContentPartDetail.High) | |
), | |
new UserChatMessage( | |
ChatMessageContentPart.CreateImageMessageContentPart( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chatClient = openAiClient.GetChatClient(deploymentName); | |
string dataURI = "data:image/jpeg;base64,<long-data-uri-of-image>"; | |
//convert data uri to binary data | |
byte[] binaryData = Convert.FromBase64String(dataURI.Split(',')[1]); | |
List<ChatMessage> messages = [ | |
new UserChatMessage( | |
ChatMessageContentPart.CreateImageMessageContentPart(BinaryData.FromBytes(binaryData), "image/jpeg", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chatClient = openAiClient.GetChatClient(deploymentName); | |
List<ChatMessage> messages = [ | |
new UserChatMessage( | |
ChatMessageContentPart.CreateImageMessageContentPart(BinaryData.FromStream(File.OpenRead("C:\\images\\ROBOT ASTRONAUT .png")), "image/jpg" , | |
ImageChatMessageContentPartDetail.High) | |
), | |
new UserChatMessage("What is in this image?") | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chatClient = openAiClient.GetChatClient(deploymentName); | |
List<ChatMessage> messages = [ | |
new UserChatMessage( | |
ChatMessageContentPart.CreateImageMessageContentPart( | |
new Uri("https://www.allrecipes.com/thmb/HbnN9fkzDBmzI83sbxOhtbfEQUE=/750x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/AR-15022-veggie-pizza-DDMFS-4x3-step-01-a32ad6054e974ecd9f79c8627bc9e811.jpg"), | |
ImageChatMessageContentPartDetail.High) | |
), | |
new UserChatMessage("What can I cook with these ingredients?"), | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Azure.AI.OpenAI; | |
using Azure; | |
using OpenAI.Chat; | |
using System.Text.Json; | |
namespace OpenAI.SDK.Test | |
{ | |
internal class Program | |
{ | |
static async Task Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import styles from './HelloTeams.module.scss'; | |
import { IHelloTeamsProps } from './IHelloTeamsProps'; | |
import { useEffect, useState } from 'react'; | |
const HelloTeams: React.FunctionComponent<IHelloTeamsProps> = (props: IHelloTeamsProps) => { | |
const [themeState, setThemeState] = useState<string>(props.teamsTheme || "default"); | |
const [styleState, setStyleState] = useState<string>(styles.containerdefault); |
NewerOlder