Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 3e40a69

Browse files
committed
clean up and more
1 parent 1eeca98 commit 3e40a69

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/example_ai_translate.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ def translate_call(cf):
99
# We also have to deal with a . in a verb - that does not work in Python. So sad.
1010
# Also, the - is actually an _ in this Python library.
1111
# This is not normally needed for other calls
12-
m = cf.accounts.ai.run
13-
m = getattr(m, '@cf')
14-
m = getattr(m, 'meta')
15-
m = getattr(m, 'm2m100_1.2b')
12+
m = cf
13+
for verb in 'accounts/ai/run/@cf/meta/m2m100_1.2b'.split('/'):
14+
m = getattr(m, verb)
1615
return m
1716

1817
def doit(account_name, english_text):

0 commit comments

Comments
 (0)