Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-pawelek committed Oct 17, 2024
1 parent 2fb9abf commit bcd9649
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,6 @@ translator = TranslatorOpenAI(api_key="YOUR_OPENAI_API_KEY", model="gpt-4o-mini"




### Setting the Azure OpenAI API Key

If you are using Azure's OpenAI services, you need to set your Azure OpenAI API key along with additional required parameters. Use the TranslatorAzureOpenAI class for this.

```python
from llmtranslate import TranslatorAzureOpenAI

# Set your Azure OpenAI API key and related parameters
translator = TranslatorAzureOpenAI(
azure_endpoint="YOUR_AZURE_ENDPOINT",
api_key="YOUR_AZURE_API_KEY",
api_version="YOUR_API_VERSION",
azure_deployment="YOUR_AZURE_DEPLOYMENT"
)

```

## Using Asynchronous Methods

The `llmtranslate` library provides asynchronous methods to allow you to perform language detection and translation tasks efficiently in an async environment. If your application uses `asyncio` or another asynchronous framework, you can take full advantage of these async methods to avoid blocking your program while waiting for language detection or translation tasks to complete.
Expand Down Expand Up @@ -220,6 +202,25 @@ Remember that asynchronous methods must be called within an `async` function. To



### Setting the Azure OpenAI API Key

If you are using Azure's OpenAI services, you need to set your Azure OpenAI API key along with additional required parameters. Use the TranslatorAzureOpenAI class for this.

```python
from llmtranslate import TranslatorAzureOpenAI

# Set your Azure OpenAI API key and related parameters
translator = TranslatorAzureOpenAI(
azure_endpoint="YOUR_AZURE_ENDPOINT",
api_key="YOUR_AZURE_API_KEY",
api_version="YOUR_API_VERSION",
azure_deployment="YOUR_AZURE_DEPLOYMENT"
)

```



## Supported Languages

llmtranslate supports all languages supported by GPT-4o. For a complete list of language codes, you can visit the [ISO 639-1 website](https://localizely.com/iso-639-1-list/).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "llmtranslate"
version = "0.4.2"
version = "0.4.3"
description = "A Python library for language detection and translation using OpenAI's GPT-4o."
authors = ["Adam Pawelek <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit bcd9649

Please sign in to comment.