Skip to content

YG3-ai/yg3-tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YG3 API Tutorials

Open In Colab License: MIT Python 3.8+

Complete tutorials and examples for building with the YG3 API (also known as CLM or Elysia API). From quick starts to production applications.

πŸš€ Quick Start β€’ πŸ“š Tutorials β€’ πŸ’‘ Examples β€’ πŸ“– API Docs


πŸš€ Quick Start

Get started with the YG3 API in under 2 minutes!

Step 1: Get Your API Key

Sign up at https://app.yg3.ai and create an API key.

Step 2: Install the SDK

pip install openai

The YG3 API is OpenAI-compatible, so you can use the familiar OpenAI SDK!

Step 3: Make Your First Request

from openai import OpenAI

client = OpenAI(
    api_key="your-api-key-here",
    base_url="https://elysia-api.ngrok.io/api/public/v1"
)

response = client.chat.completions.create(
    model="elysia",
    messages=[
        {"role": "user", "content": "Hello! Tell me about yourself."}
    ]
)

print(response.choices[0].message.content)

That's it! You're now using the YG3 API. πŸŽ‰

Quick Tips

  • πŸ’‘ The API is OpenAI-compatible - swap your base URL and you're good to go
  • πŸ”„ Supports streaming responses
  • πŸ› οΈ Works with function calling and tool use
  • πŸ“¦ Compatible with LangChain, LlamaIndex, and other frameworks

πŸ“š Tutorials

🟒 Part 1: Building a ReAct Customer Support Agent

Status: βœ… Complete | Difficulty: Beginner | Time: 10 minutes

Learn how to build an AI agent that can search knowledge bases, check orders, and provide automated customer support using the ReAct (Reasoning + Acting) pattern.

What You'll Build:

  • Intelligent customer support agent
  • Tool calling with function execution
  • Interactive Gradio web interface
  • Production-ready code

Key Concepts:

  • ReAct pattern
  • Tool/function calling
  • Prompt engineering
  • Agent loops

πŸ‘‰ Start Tutorial β†’

Quick Stats: This is the #1 most popular agent pattern in 2025 (45.8% of AI agents use it)


🚧 More Tutorials Coming Soon!

We're building a comprehensive tutorial library covering:

  • πŸ“– Different application types
  • 🎯 Various use cases
  • πŸ’Ό Production patterns
  • πŸ”§ Integration guides
  • πŸš€ Deployment strategies

Want to see something specific? Open an issue to suggest a tutorial!


πŸ’‘ What is the YG3 API?

The YG3 API (also known as the CLM or Elysia API) is a powerful, OpenAI-compatible API for building intelligent applications.

Why YG3?

  • πŸ”Œ OpenAI Compatible - Drop-in replacement, use the same code
  • ⚑ Fast & Reliable - Production-grade infrastructure
  • πŸ’° Cost-Effective - Competitive pricing
  • πŸ› οΈ Developer-Friendly - Excellent documentation and support
  • 🎯 Powerful - Advanced language understanding and generation with the YG3 family of Concentrated Language Models (CLMs)

Key Features

βœ… Chat Completions - Conversational AI βœ… Function Calling - Tool use and actions βœ… Streaming - Real-time responses βœ… Context Windows - Handle long conversations βœ… Framework Support - LangChain, LlamaIndex, and more


πŸ”§ Integration Examples

With LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="elysia",
    openai_api_key="your-api-key",
    openai_api_base="https://elysia-api.ngrok.io/api/public/v1"
)

response = llm.invoke("What can you help me build?")
print(response.content)

With LlamaIndex

from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="elysia",
    api_key="your-api-key",
    api_base="https://elysia-api.ngrok.io/api/public/v1",
    is_chat_model=True
)

response = llm.complete("Explain quantum computing")
print(response)

Function Calling

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {"type": "string"}
                }
            }
        }
    }
]

response = client.chat.completions.create(
    model="elysia",
    messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
    tools=tools
)

πŸ“– API Reference

Base URL

https://elysia-api.ngrok.io/api/public/v1

Available Models

  • elysia - Main production model

Authentication

# Add to header
Authorization: Bearer YOUR_API_KEY

# Or in SDK
client = OpenAI(api_key="YOUR_API_KEY", base_url="...")

Common Parameters

Parameter Type Description
model string Model to use (e.g., "elysia")
messages array Conversation messages
temperature float Randomness (0.0-2.0), default 0.7
max_tokens integer Max response length
stream boolean Enable streaming responses
tools array Available functions/tools

Full API documentation: https://help.yg3.ai


πŸ—οΈ Repository Structure

yg3-tutorials/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ tutorials/                         # Complete tutorials
β”‚   └── react-customer-support-agent/ # Part 1: ReAct agent
β”‚       β”œβ”€β”€ README.md
β”‚       └── Customer_Support_Demo.ipynb 
β”‚
β”œβ”€β”€ examples/                          # Quick examples [COMING SOON]
β”‚   β”œβ”€β”€ quickstart/                   # Getting started examples [COMING SOON]
β”‚   β”œβ”€β”€ streaming/                    # Streaming responses [COMING SOON]
β”‚   β”œβ”€β”€ function-calling/             # Tool use examples [COMING SOON]
β”‚   └── integrations/                 # Framework integrations [COMING SOON]
β”‚
└── resources/                         # Additional resources [COMING SOON]
    β”œβ”€β”€ api-reference.md              # Detailed API docs [COMING SOON]
    β”œβ”€β”€ best-practices.md             # Tips and patterns [COMING SOON]
    └── troubleshooting.md            # Common issues [COMING SOON]

🎯 Use Cases

What can you build with the YG3 API?

Business Applications

  • πŸ€– Customer Support - Automated support agents
  • πŸ“§ Email Automation - Smart email responses
  • πŸ“Š Data Analysis - Natural language to insights
  • πŸ’Ό Sales Assistance - Lead qualification and follow-up

Developer Tools

  • πŸ’» Code Assistance - Code generation and review
  • πŸ“ Documentation - Auto-generated docs
  • πŸ§ͺ Testing - Test case generation
  • πŸ” Code Search - Natural language code search

Content Creation

  • ✍️ Writing - Blog posts, articles, copy
  • 🎨 Marketing - Ad copy, social media
  • πŸ“š Education - Lesson plans, explanations
  • 🌐 Translation - Multilingual content

Advanced Applications

  • 🧠 AI Agents - Autonomous decision-making systems
  • πŸ”— Workflows - Intelligent automation
  • 🎯 Personalization - Tailored user experiences
  • πŸ“ˆ Analytics - Conversational business intelligence

πŸš€ Getting Started Paths

Path 1: Complete Beginner

Goal: Learn the basics

  1. Read the Quick Start
  2. Make your first API call
  3. Try different parameters
  4. Explore Tutorial 1

Time: 30 minutes


Path 2: Experienced Developer

Goal: Build production apps quickly

  1. Skim Quick Start
  2. Review API Reference
  3. Check Integration Examples
  4. Build your use case
  5. Review Best Practices

Time: 15 minutes to first app


Path 3: Framework User

Goal: Integrate with existing tools

  1. Find your framework in Integration Examples
  2. Swap base URL in your existing code
  3. Test with YG3 API
  4. Deploy

Frameworks Supported:

  • LangChain
  • LlamaIndex
  • Haystack
  • Semantic Kernel
  • AutoGen
  • CrewAI

Time: 5 minutes


πŸ’Ό Production Checklist

Ready to deploy? Make sure you have:

  • Error Handling - Catch and handle API errors
  • Rate Limiting - Implement backoff strategies
  • API Key Security - Never expose in client-side code
  • Logging - Track usage and errors
  • Monitoring - Alert on failures
  • Cost Tracking - Monitor token usage
  • Fallbacks - Handle API downtime
  • Testing - Unit and integration tests

See Best Practices for details.


🀝 Contributing

We welcome contributions! Here's how:

Add a Tutorial

  1. Fork this repository
  2. Create a new folder in tutorials/
  3. Include: README, code, notebook
  4. Submit a pull request

Improve Examples

  • Fix bugs
  • Add new examples
  • Improve documentation
  • Share your use case

Report Issues


πŸ’¬ Community & Support

Get Help

Share Your Work

Built something cool? Share it!

  • Show and Tell
  • Tag #YG3API on social media
  • Submit to our showcase

πŸ—ΊοΈ Roadmap

Current

  • βœ… Quick Start guide
  • βœ… Tutorial 1: ReAct Customer Support Agent
  • βœ… Integration examples
  • βœ… API reference

Coming Soon

  • 🚧 More comprehensive tutorials
  • 🚧 Additional code examples
  • 🚧 Video walkthroughs
  • 🚧 Community showcase
  • 🚧 Advanced patterns and use cases

Want to influence the roadmap? Share your ideas


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

You're free to use, modify, and distribute this code for any purpose.


πŸ™ Acknowledgments

  • YG3 Team - For building an amazing API
  • OpenAI - For the API standard
  • Community Contributors - Everyone who improves these tutorials
  • You - For building with YG3!

⭐ Star This Repo

If these tutorials helped you, give us a star! ⭐

It helps others discover these resources.


Ready to build something amazing?

πŸš€ Get Your API Key | πŸ“š Start Tutorial 1 | πŸ’¬ Join Community


Built for developers, by developers πŸ’™

About

Get started using the YG3 API and start using powerful Concentrated Language Models (CLMs) in your apps today.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors