Closed geweb7 closed 4 months ago
Are you able to get the text by:
response = co.chat(message = "what day is it today?")
print(response.text)
yes, now i use it like this, but feeling not sure it's the correct way.
the same with printing let's say output_tokens
This is the correct way to access the text.
response = co.chat(message = "what day is it today?") print(response)
it seems to be plain text format:
text='Today is Friday, April 12, 2024.' generation_id='...' citations=None documents=None is_search_required=None search_queries=None search_results=None finish_reason='COMPLETE' tool_calls=None chat_history=[ChatMessage(role='USER', message='what day is it today?'), ChatMessage(role='CHATBOT', message='Today is Friday, April 12, 2024.')] meta=ApiMeta(api_version=ApiMetaApiVersion(version='1', is_deprecated=None, is_experimental=None), billed_units=ApiMetaBilledUnits(input_tokens=6, output_tokens=15, search_units=None, classifications=None), tokens=ApiMetaTokens(input_tokens=72, output_tokens=15), warnings=None) response_id='...'
how should we extract text from the response? Please return json in NONSTREAMEDCHATRESPONSE and update docs on getting response text.