FormidableLabs / FormidableLabs/babel-bridge

Translation: Sanitise LLM data with structured output parsing

Open
#11 1 comment 0 reactions 0 assignees View on GitHub
nice to have translation
Dominant language
TypeScript
Stars
6
Forks
0
PR merge metrics
No merged PRs in 30d

Description

# Description

Currently the translation functionality is reliant on the output of the LLM being in a specific format. We want to move away from this and instead use a structured output format that can easily be parsed.

Investigate usage of the following pattern for structured output: https://js.langchain.com/docs/modules/chains/popular/structured_output

If this is suitable, then update the [`translate`](https://github.com/bryceknz/sanity-translations-experiment/blob/db6530f9d455fe1d7a5bd5d31edc59aab33382c9/server/translation.ts#L13) function to use this format.

# Acceptance criteria

- [ ] [`translate`](https://github.com/bryceknz/sanity-translations-experiment/blob/db6530f9d455fe1d7a5bd5d31edc59aab33382c9/server/translation.ts#L13) function is updated to use structured output
- [ ] [`extractJSON`](https://github.com/bryceknz/sanity-translations-experiment/blob/db6530f9d455fe1d7a5bd5d31edc59aab33382c9/server/utils.ts#L9) function is removed or updated as required

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.