[project-demos]: Create demo LlmTornado using OpenAI #363
+831
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LlmTornado OpenAI Examples
Description
LlmTornado OpenAI Examples is a web application demonstrating the LlmTornado library capabilities for interacting with OpenAI models. It features multiple chat interfaces including simple streaming chat and AI agents with function calling/tools support.
LlmTornado.with.OpenAI.mp4
One-Click Development Environment
Click the badge above to open Ivy Examples repository in GitHub Codespaces with:
Created Using Ivy
Web application created using Ivy-Framework.
Ivy - The ultimate framework for building internal tools with LLM code generation by unifying front-end and back-end into a single C# codebase. With Ivy, you can build robust internal tools and dashboards using C# and AI assistance based on your existing database.
Ivy is a web framework for building interactive web applications using C# and .NET.
Interactive Examples for LlmTornado Library
This example demonstrates various capabilities of the LlmTornado library for interacting with LLM models. The application showcases streaming responses, function calling with tools, and agent-based interactions.
What This Application Does:
This implementation creates an LlmTornado OpenAI Examples workspace that allows users to:
Technical Implementation:
UseState,UseEffect) for reactive UI updatesExamples
Simple Chat
Basic conversation interface with streaming responses. Perfect for simple Q&A interactions with OpenAI models.
Features:
Agent with Tools
AI agent with function calling capabilities. The agent can use tools to perform actions like getting the current time, performing calculations, and getting weather information.
Features:
Note: Not all models support function calling. The application will display a helpful message if the selected model doesn't support tools.
Tools
Prerequisites
How to Run
Get your OpenAI API Key:
Navigate to the example:
cd project-demos/llm-tornado-openaiRestore dependencies:
Set up OpenAI API Key using dotnet user-secrets:
Run the application:
Open your browser to the URL shown in the terminal (typically
http://localhost:5010)How to Deploy
Deploy this example to Ivy's hosting platform:
Navigate to the example:
cd project-demos/llm-tornado-openaiDeploy to Ivy hosting:
Configure environment variables in your deployment settings:
OpenAI:ApiKeyto your OpenAI API keyOpenAI:Modelto your preferred model (e.g.,gpt-4o-mini)This will deploy your LlmTornado OpenAI examples with a single command.
Project Structure
Learn More
Tags
AI, LLM, OpenAI, LlmTornado, Chat, Function Calling, Tools, Streaming, Agents, GPT-4, GPT-3.5, Markdown, User Secrets