Skip to content

Bikatr7/easytl-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Table of Contents


Notes

This repository demonstrates a use case for the EasyTL Python package. EasyTL GitHub Repository

This repository contains examples of how to use EasyTL with the Gemini, OpenAI, Anthropic, and DeepL APIs. EasyTL also supports Google Translate and Microsoft Azure Translator, but these are not demonstrated here.


Getting Started

  1. Clone the repository:

    git clone https://github.com/Bikatr7/easytl-demo.git
  2. Navigate to the project directory:

    cd easytl-demo
  3. Install the required packages:

    pip install -r requirements.txt
  4. Create the following API key files in the root directory (at least one is required):

    • gemini.txt with your Google API key
    • openai.txt with your OpenAI API key
    • anthropic.txt with your Anthropic API key
    • deepl.txt with your DeepL API key

Running the Code Examples

Pick an example from the examples directory and run it. For example:

python examples/basic_gemini_example.py

In the root of examples/, you will find generic basic examples for each API. You can use these as a starting point for what EasyTL can do. Some examples require specific APIs. See the Available Examples section for more information.

Available Examples (More to come)

Basic Examples (in examples/)

  • basic_gemini_example.py - Demonstrates the basic functionality of EasyTL with the Gemini API
  • basic_openai_example.py- Demonstrates the basic functionality of EasyTL with the OpenAI API
  • basic_anthropic_example.py - Demonstrates the basic functionality of EasyTL with the Anthropic API
  • basic_deepl_example.py - Demonstrates the basic functionality of EasyTL with the DeepL API

JSON Response Examples (in examples/structured_json/)

  • json_gemini_example.py - Demonstrates how to return a JSON response with EasyTL using the Gemini API
  • json_openai_example.py - Demonstrates how to return a JSON response with EasyTL using the OpenAI API

Production code examples (in examples/production_code/)

These examples are not intended to be actually ran, but rather to showcase how EasyTL can be used in production code.

  • cost_estimate_example.py - Showcases some production code found in Kudasai that uses EasyTL to estimate the cost of a translation job.
  • translation_example.py - Showcases some production code found in Kudasai that uses EasyTL to translate text.

About

This repo showcases use cases and applications of EasyTL

Topics

Resources

License

Stars

Watchers

Forks