Skip to content
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

Handle assistant messages with 'tool_calls' #824

Merged
merged 8 commits into from
Nov 11, 2024

Conversation

Jeadie
Copy link
Contributor

@Jeadie Jeadie commented Oct 4, 2024

Changes

  • The core change here is
-pub type MessageContent = Either<String, Vec<IndexMap<String, String>>>;
+pub type MessageContent = Either<String, Vec<IndexMap<String, Value>>>;
  • Also, change BasicProcessor to use template_action() -> MessagesAction::Keep (instead of MessagesAction::FlattenOnlyText) .

Fixes

Copy link

github-actions bot commented Oct 4, 2024

Code Metrics Report
  ===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 C Header                2           35           28            0            7
 Dockerfile              1           41           22           10            9
 Happy                   1          442          369            0           73
 JSON                   12          105          104            0            1
 Python                 53         2274         1949           63          262
 Shell                   1           57           22           18           17
 TOML                   18          581          518            2           61
 YAML                    2           21           19            2            0
-------------------------------------------------------------------------------
 Jupyter Notebooks       4            0            0            0            0
 |- Markdown             2           77           32           31           14
 |- Python               2          196          169            1           26
 (Total)                            273          201           32           40
-------------------------------------------------------------------------------
 Markdown               40         3009            0         2286          723
 |- BASH                 6          101           98            0            3
 |- JSON                 1           12           12            0            0
 |- Python               6          114          102            0           12
 |- Rust                10          361          306            0           55
 |- TOML                 2           75           63            0           12
 (Total)                           3672          581         2286          805
-------------------------------------------------------------------------------
 Rust                  278        83174        74643         1743         6788
 |- Markdown           134         1413           25         1285          103
 (Total)                          84587        74668         3028         6891
===============================================================================
 Total                 413        89739        77674         4124         7941
===============================================================================
  

Copy link
Owner

@EricLBuehler EricLBuehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Jeadie! Thanks for the PR. I think this looks good, but I was wondering if you could also please update the new Rust API (specifically, the tools and tools_llama_8b examples)? Perhaps you could create a method to add a tool call message?

Please let me know!

@EricLBuehler
Copy link
Owner

Friendly ping @Jeadie

@Jeadie
Copy link
Contributor Author

Jeadie commented Oct 15, 2024

Will do today

Jeadie and others added 2 commits October 16, 2024 11:31
Add better methods for using tools in  and update examples
@Jeadie
Copy link
Contributor Author

Jeadie commented Oct 17, 2024

I don't seem to have visibility into the failing check: https://github.com/EricLBuehler/mistral.rs/actions/runs/11357273044/job/31589861979?pr=824

@EricLBuehler
Copy link
Owner

@Jeadie I reran the check and it passed. Please let me know when this is ready for review!

@Jeadie
Copy link
Contributor Author

Jeadie commented Oct 22, 2024

This is ready to review

Copy link
Owner

@EricLBuehler EricLBuehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@EricLBuehler
Copy link
Owner

@Jeadie I noticed there are some outstanding merge conflicts, could you please resolve those? Thanks.

@Jeadie
Copy link
Contributor Author

Jeadie commented Nov 10, 2024

@EricLBuehler Updated, thanks.

@EricLBuehler
Copy link
Owner

Thank you!

@EricLBuehler EricLBuehler merged commit ddc63f1 into EricLBuehler:master Nov 11, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants