OoriData / OgbujiPT

Client-side toolkit for using large language models, including where self-hosted
Apache License 2.0
102 stars 8 forks source link

Change metadata_json to metadata for `chatlog` table. #63

Closed kaischuygon closed 10 months ago

kaischuygon commented 10 months ago

While working on an Oori product we were cleaning up naming & noticed this bit of redundancy from OgbujiPT.

See (if you have access): https://github.com/OoriData/OoriChat/issues/97.

uogbuji commented 10 months ago

Oops! We don't seem to have a test suite for MessageDB. I'll string one together. That makes me think: for consistency, we sometimes refer to the items as messages, sometimes as chat. I'm thinking "message" is more generic, and broader, even though we're primarily using this for online chat ATM. I propose keeping the class name as MessageDB, but changing e.g. "chatlog" to "message_log" throughout the code. Luckily, this latter change won't really affect anything at the interface level, but @kaischuygon & @choccccy just wanted a quick check what you think.

uogbuji commented 10 months ago

Hmm. Test suite still not working in CI. @kaischuygon do you have a beat to investigate? https://github.com/OoriData/OgbujiPT/actions/runs/7358394631

kaischuygon commented 10 months ago

I can investigate later today.

kaischuygon commented 10 months ago

@uogbuji Seemed to be an issue with openai's API, they added logprobs to Choice that pydandic was expecting. Set to None per this page and seems to be working again.

kaischuygon commented 10 months ago

This run https://github.com/OoriData/OgbujiPT/actions/runs/7360059329 succeeded with this change.

uogbuji commented 10 months ago

@uogbuji Seemed to be an issue with openai's API, they added logprobs to Choice that pydandic was expecting. Set to None per this page and seems to be working again.

Oh weird! Not what I thought it was at all, from looking at the CI logs, but I'll take the W!

uogbuji commented 10 months ago

There turned out to be much more packed into this issue than expected, once I decided to add the missing test cases.