From 92d8a38e1084381ccc0834978b417d1ecc843fc6 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 29 Oct 2024 07:14:51 -0400 Subject: [PATCH] Add translate_text.py example for translating text to French --- examples/translate_text.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/translate_text.py diff --git a/examples/translate_text.py b/examples/translate_text.py new file mode 100644 index 0000000..e7d1d3e --- /dev/null +++ b/examples/translate_text.py @@ -0,0 +1,9 @@ +from _context import sm + +conversation = sm.create_conversation(llm_model="gpt-4o", llm_provider="openai") + +conversation.add_message( + "user", "Translate the following text to French: 'Hello, world!'" +) + +print(conversation.send().text)