Open
Description
Test Code work only in Linux:
import together
def interact():
client = together.Together(api_key='...')
messages = [{"role": "system", "content": "You are a news aggregator"}]
while True:
response = client.chat.completions.create(
model='meta-llama/Llama-3.3-70B-Instruct-Turbo',
messages = messages,
stream = False,
)
choices = [ {'role': choice.message.role, 'content': choice.message.content} for choice in response.choices if choice.message.role == 'assistant' ]
messages += choices
user_message = yield '\n'.join(c['content'] for c in choices)
messages += [{"role": "user", "content": user_message}]
# Test Code
generator = interact(); generator.send(None)
while True:
print("\n-->")
user_message = ''
while True:
line = input()
user_message += line + '\n'
if user_message.endswith('\n\n\n'):
user_message = user_message.strip()
break
print("<--")
response = generator.send(user_message)
print(response)
Conlose outputs in Linux - OK
Console outputs in Windows - BUGGY
In Windows only the first interaction works. The rest of the interactions are sprinkled with exceptions.
Other providers compatible with OpenAI work well in Windows (on the same test code)
Metadata
Metadata
Assignees
Labels
No labels