comet-ml / opik

Open-source end-to-end LLM Development Platform
Apache License 2.0
2.12k stars 132 forks source link

[Bug]: YAML is not correctly formatted for some strings #522

Closed jverre closed 5 days ago

jverre commented 2 weeks ago

Willingness to contribute

No. I can't contribute a fix for this bug at this time.

What component(s) are affected?

Opik version

Describe the problem

Sometimes when I log data, the data is rendered nicely when viewing it using the YAML formatter and new line characters are rendered using new lines. However sometimes the input is displayed as a string and not formatted in an easy to read manner. This seems related to some special characters like \r or \t

Reproduction steps

%pip install opik
import opik

opik.configure()

client=opik.Opik()
client.trace(name="test", input={"input": "\n\rtest\n"})
jverre commented 2 weeks ago

This is an issue with the underlying library we are using, we patched it for \t last week: https://github.com/comet-ml/opik/pull/476/files. Seems like there is a similar issue with other characters as well. We will look at adding support for common "special characters": \t, \n, \r, \v, \f and \b

jverre commented 1 week ago

@ferc Can you take a look