Dictionary
Dictionary
toothfairyai@latest…Manager for dictionary entries operations.
This manager provides methods to create, update, and manage dictionary entries.
Example:
>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> dictionary_entry = client.dictionary.get(...)
Accessed via client.dictionary.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
get | GET | GET /dictionary/get/{dictionary_entry_id} |
list | GET | GET /dictionary/list |
get_by_language_pair | — | derived |
search | — | derived |
get
Get a dictionary_entry by ID.
def get(dictionary_entry_id: str) -> DictionaryEntry
Endpoint: GET /dictionary/get/{dictionary_entry_id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the dictionary entry |
owner | string | User ID who owns the dictionary entry |
sourceLanguage | string | Source language code |
targetLanguage | string | Target language code |
sourceText | string | Source text to translate |
targetText | string | Translated target text |
workspaceID | string | Unique workspace identifier (UUID v4) |
pos | string | Part of speech classification |
description | string | Dictionary entry description |
createdBy | string | User ID who created the entry |
updatedBy | string | User ID who last updated the entry |
createdAt | string | Timestamp when this resource was created |
updatedAt | string | Timestamp when this resource was last updated |
Example
client.dictionary.get(dictionary_entry_id="agent-id")
list
List all dictionary entries.
def list(
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse
Endpoint: GET /dictionary/list · API service
Example
client.dictionary.list()
get_by_language_pair
Get dictionary entries by language pair.
def get_by_language_pair(
source_language: str,
target_language: str
) -> List[DictionaryEntry]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.dictionary.get_by_language_pair(source_language="…", target_language="…")
search
Search dictionary entries by source text.
def search(search_term: str) -> List[DictionaryEntry]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.dictionary.search(search_term="…")