Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenAI] [Scenario] Add abstractions for chat conversations #42538

Open
joseharriaga opened this issue Mar 8, 2024 · 1 comment
Open

[OpenAI] [Scenario] Add abstractions for chat conversations #42538

joseharriaga opened this issue Mar 8, 2024 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. OpenAI
Milestone

Comments

@joseharriaga
Copy link
Member

From @trrwilson:

ChatClient client = GetTestClient();

ChatConversation conversation = new(client)
{
    InitialMessages =
    [
        ChatRequestMessage.CreateSystemMessage(
            "You are a culinary expert who speaks like a stereotypical caricature of a New Yorker."),
    ],
    Functions = new ChatFunctions(typeof(CulinaryDatabaseTools)),
};

ChatCompletion chatCompletion = conversation.CompleteChat("What are some of the best pizza toppings?");
chatCompletion = conversation.CompleteChat("Which of those are vegetarian-friendly?");
chatCompletion = conversation.CompleteChat("Are any of those spicy?");

conversation.Reset();
chatCompletion = conversation.CompleteChat("What's the best way to cook a pumpkin pie?");
@joseharriaga joseharriaga added Client This issue points to a problem in the data-plane of the library. OpenAI labels Mar 8, 2024
@joseharriaga joseharriaga added this to the Backlog milestone Mar 8, 2024
@pallavit
Copy link
Contributor

What benefit does ChatConversation give us over ChatCompletion? Is the usecase purely enabling support for post processing - so function calls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. OpenAI
Projects
None yet
Development

No branches or pull requests

2 participants