Abraxas-365 / langchain-rust

🦜️🔗LangChain for Rust, the easiest way to write LLM-based programs in Rust
MIT License
491 stars 63 forks source link

fix: claude system message error #180

Closed cs50victor closed 2 months ago

cs50victor commented 2 months ago

Fixes claude system message error when using it an LLM Agent.

'messages: Unexpected role "system". The Messages API accepts a top-level 'system' parameter, not "system" as an input message role.'

How to reproduce error: replace OpenAI with Claude as the LLM in this example:

https://github.com/Abraxas-365/langchain-rust/blob/main/examples/open_ai_tools_agent.rs