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

doc: openAIChat #63

Closed
wants to merge 54 commits into from
Closed

doc: openAIChat #63

wants to merge 54 commits into from

Conversation

MiriamScharnke
Copy link
Collaborator

@MiriamScharnke MiriamScharnke commented Jul 29, 2024

Create functions directory in the doc folder and add openAIChat documentation.

ccreutzi and others added 18 commits July 25, 2024 12:45
* Refactor `messageHistory` to be agnostic of the image encoding.
* Add backend encoding of images to `openAIChat`, `azureChat`, and `ollamaChat`.
* Add image test points to the test files.

Open question: Can we reliably detect which Ollama models support vision?
Preinstall bakllava, to have a vision model
Co-authored-by: MiriamScharnke <[email protected]>
Generating Markdown in pre-commit hook.

The hook needs to be activated in the local repository, by including it in `.git/hooks/pre-commit`.
Future versions will get that automatically, from commit 570aaa1.
…g/llms-with-matlab into generate-md-from-mlx
@MiriamScharnke MiriamScharnke changed the title Create functions directory in the doc folder and add openAIChat docum… doc: openAIChat Jul 29, 2024
Copy link
Member

@ccreutzi ccreutzi left a comment

Choose a reason for hiding this comment

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

I wish I could mark individual comments as “request change” or “just an aside, feel free to ignore.”

I think the only thing where I have a flag is the Tools documentation. Let me know if the functionality there is completely opaque – we didn't come up with the terminology.

doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
MiriamScharnke and others added 3 commits July 29, 2024 16:10
Co-authored-by: Christopher Creutzig <[email protected]>
I know why those happened, and can avoid them in the future!

In MLX files, you can create hyperlinks which link to lines in the same file. I tried to see whether this would translate into the markdown - turns out it hasn't. What it has done is taken those hyperlinks and just given them extra backticks with no functionality. So long as I stop trying to link between passages, this should not be an issue.

Co-authored-by: Christopher Creutzig <[email protected]>
Co-authored-by: Christopher Creutzig <[email protected]>
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
doc/functions/openAIChat.md Outdated Show resolved Hide resolved
Instead of using the `APIKey` name\-value argument, you can also set the environment variable OPEN\_API\_KEY. For more information, see [https://github.com/matlab\-deep\-learning/llms\-with\-matlab/blob/main/doc/OpenAI.md](https://github.com/matlab-deep-learning/llms-with-matlab/blob/main/doc/OpenAI.md).
Instead of using the `APIKey` name\-value argument, you can also set the environment variable OPEN\_API\_KEY. For more information, see [OpenAI API](../OpenAI.md).

---
Copy link
Member

Choose a reason for hiding this comment

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

These lines look heavier in the preview than the section break for “Properties Settable at Construction” below.

Comment on lines 280 to 245
generate(chat,"Why is a raven like a writing desk?")
generate(chat,"Why is a raven like a writing desk?");
Copy link
Member

Choose a reason for hiding this comment

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

Generating text and discarding the output without saving it anywhere seems a bit pointless. Can we remove the semicolon?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can; do you want me to actually generate some text and also print the output?

Copy link
Member

Choose a reason for hiding this comment

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

Possibly? Maybe faked or with an elision, so it doesn't get too long?

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 95.89041% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.11%. Comparing base (c607360) to head (c357e75).
Report is 5 commits behind head on documentation.

Files Patch % Lines
azureChat.m 87.50% 3 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           documentation      #63      +/-   ##
=================================================
- Coverage          97.13%   97.11%   -0.03%     
=================================================
  Files                 39       41       +2     
  Lines               1292     1350      +58     
=================================================
+ Hits                1255     1311      +56     
- Misses                37       39       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

MiriamScharnke and others added 20 commits August 1, 2024 17:06
…nces

Allow (long) char vectors for StopSequences
moondream is a much smaller vision model and perfectly suitable for the tests we want to run.
To decouple `texampleTests.m` from availability and speed of external servers,
record calls to `llms.internal.sendRequest` (on dev machine) and replay
(during most test runs, including CI). See tests/recording/README.md for
instructions.
The streaming interface sometimes responds with something like `json.choices = {"index":0,"delta":{},"logprobs":[],"finish_reason":"length"}`. Stop blindly assuming `json.choices.delta.content` exists.
Avoid bogus access to `json.choices.delta.content`
Trace/replay `llms.internal.sendRequest`
Co-authored-by: Christopher Creutzig <[email protected]>
@MiriamScharnke MiriamScharnke deleted the doc-openaichat branch August 9, 2024 12:06
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.

3 participants