Skip to content

Does guardrails project support chinese language? #711

Closed Answered by jsoma
lizhe2004 asked this question in Q&A
Discussion options

You must be logged in to vote

Short answer

Yes! Guardrails acts between your content and the LLM, so as long as the LLM can understand Chinese you will be good.

...but I thought this was pretty interesting so I also wrote up a few examples! I always use Guardrails with pydantic models so that's what my examples below are all using, but I'm sure it works for everything.

Long answer 1 (Asking questions in Chinese)

In this example below, I have it analyze a short text in Chinese and extract/categorize information, along with validating the responses.

import openai
from pydantic import BaseModel, Field
from guardrails.hub import ValidChoices
from guardrails import Guard

prompt = """
Comment to analyze: ${text}

${gr.comp…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lizhe2004
Comment options

Answer selected by lizhe2004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants