-
Notifications
You must be signed in to change notification settings - Fork 840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ollama: add support for moderation model #3028
Conversation
efb7e40
to
48a9dc2
Compare
87d26cf
to
bc5aa1a
Compare
bc5aa1a
to
b3799b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job @rockwotj! Just left a few nits. Feel free to
internal/plugins/info.csv
Outdated
@@ -155,6 +155,7 @@ ockam_kafka ,input ,ockam_kafka ,0.0.0 ,commun | |||
ockam_kafka ,output ,ockam_kafka ,0.0.0 ,community ,n ,n ,n | |||
ollama_chat ,processor ,ollama_chat ,4.32.0 ,enterprise ,n ,n ,y | |||
ollama_embeddings ,processor ,ollama_embeddings ,4.32.0 ,enterprise ,n ,n ,y | |||
ollama_moderation ,processor ,ollama_moderation ,0.0.0 ,enterprise ,n ,n ,y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to set the version in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -121,6 +122,9 @@ For more information, see the https://github.com/ollama/ollama/tree/main/docs[Ol | |||
Optional(). | |||
Advanced(). | |||
Description(`Sets the stop sequences to use. When this pattern is encountered the LLM stops generating text and returns the final response.`), | |||
service.NewBoolField(ocpFieldEmitPromptMetadata). | |||
Default(false). | |||
Description(`If enabled the prompt is saved as @prompt metadata on the output message.`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also mention system_prompt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - yes
p, err := o.prompt.TryString(msg) | ||
if err != nil { | ||
return nil, err | ||
} | ||
r, err := o.response.TryString(msg) | ||
if err != nil { | ||
return nil, err | ||
} | ||
g, err := o.generateCompletion(ctx, p, r) | ||
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding some extra context to these errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This allows us to classify LLM responses for safety.