This code throws an error: """ from together import Together import os…
- User
This code throws an error: """ from together import Together import os os.environ["TOGETHER_API_KEY"] = "tgp_v1_gvDcBb9V-suRtciB2EBmY9pT1uBjcbLN9emimHfZXYg" client = Together() response = client.chat.completions.create( model="Qwen/Qwen3-235B-A22B-fp8-tput", messages=[ { "role": "system", "content": PARSING_DIALOGUE_V2 }, { "role": "user", "content": sample } ], response_format={ "type": "json_schema" }, temperature=0., max_output_tokens=8192, top_p=1, store=True ) print(response.choices[0].message.content) """ While this doesn't: """ from together import Together import os os.environ["TOGETHER_API_KEY"] = "tgp_v1_gvDcBb9V-suRtciB2EBmY9pT1uBjcbLN9emimHfZXYg" client = Together() response = client.chat.completions.create( model="Qwen/Qwen3-235B-A22B-fp8-tput", messages=[ { "role": "system", "content": PARSING_DIALOGUE_V2 }, { "role": "user", "content": sample } ], text={ "format": { "type": "json_object" } }, temperature=0., max_output_tokens=32000, top_p=1, store=True ) print(response.choices[0].message.content)"""
Can you explain why?
- Assistant
Yes — the key issue lies in the difference between the response_format parameter (which throws an error) and the text parameter (which works). These are not interchangeable, and their expected structure differs based on the Together API's client library and how it wraps LLM endpoints.
- User
This is not the problem. I'm running this on the playground but on my device it doesn
- Assistant
Thanks for clarifying — the key detail is that this code behaves differen
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.