check FIM response for expected format #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially fixes #61 by handling errors gracefully (though it will not help users discover that their entire server is set up incorrectly).
Also does not explain why llama-server sometimes hasBut, it does handle unexpected server responses gracefully.sequence 0 does not start from the last position stored in the memory
errors.This approach handles unexpected issues upon server response in
fim_on_response
, avoiding taking up slots in the cache with invalid responses. You can test it with a couple of examples by entering these commands:Not valid JSON (endpoint returns HTML)
Valid JSON missing the
content
keyIt might be overkill to check the JSON string before decoding, I was just worried about small performance hits from unnecessarily doing full JSON decodes, especially since this can happen on every keypress if the responses are invalid, since there will never be cache hits.