docs/tutorials/classification/ #28778
Replies: 9 comments 6 replies
-
But the restrictions have not taken effect in this sentence“Classification(sentiment='enojado', aggressiveness=8, language='es')” |
Beta Was this translation helpful? Give feedback.
-
Is this specific to OpenAI? Is it possible to get Ollama -llama3 version. |
Beta Was this translation helpful? Give feedback.
-
This tutorial does not work either with Gemini (1.5, flash or pro) or with any HuggingFace model. |
Beta Was this translation helpful? Give feedback.
-
I managed to make structured output work with the Deepseek model, and I think this approach may work for other non-OpenAI models as well. The main concept is to include our output requirements directly in the prompt and manually parse the JSON response into a BaseModel. https://github.com/NihilDigit/DeepSeek-Structured-Output-for-LangChain |
Beta Was this translation helpful? Give feedback.
-
FYI, It works perfectly with just English sentences. I added one more property
and it returned true If I passed an input like this "I hate youu" in English, and it returned false if I passed the same message but in Ukrainian. |
Beta Was this translation helpful? Give feedback.
-
I needed to make the Classification fields optional for this work
|
Beta Was this translation helpful? Give feedback.
-
I use Groq and it gives the expected output remove the first llm chat model statement
change the second llm statement from
complete version below:
output:
|
Beta Was this translation helpful? Give feedback.
-
When i use enum of pydantic BaseModel Field, it has warning: And i run the code, it has some error: TypeError: Parameter to CopyFrom() must be instance of same class: expected <class 'Schema'> got <class 'dict'>. During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) TypeError: bad argument type for built-in operation some lib version: |
Beta Was this translation helpful? Give feedback.
-
Hi All, For those trying to follow this tutorial using Gemini, here's the full code. I encounter two things to watch out for: 1 - Pydantic's Field(..., enum=[...]) is not valid for specifying enums in Pydantic v1 or v2.
Output:
Just to say too a huge thank you to those putting these tutorials together! They are incredibly helpful and well structured. Ed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
docs/tutorials/classification/
Open In Colab
https://python.langchain.com/docs/tutorials/classification/
Beta Was this translation helpful? Give feedback.
All reactions