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

feat: minor API improvements #758

Merged
merged 12 commits into from
Feb 10, 2025
Merged

Conversation

mattjohnsonpint
Copy link
Member

Description

Some API improvements and other misc changes that have been accumulating locally, now ready for publishing.

Highlights:

  • Use correct terminology "connection" instead of "host" everywhere, to align with manifest change made long ago.
  • Update AssemblyScript to latest version 0.27.34 which adds:
    • support for rest params, simplifying a few of our APIs
    • corrects output from f32.toString, improving vector arrays represented in JSON
  • Dgraph API improvements:
    • closer alignment between Go and AssemblyScript SDKs by adding constructor functions in the Go SDK, and fluent APIs for setting variables and configuring mutations to both SDKs.
    • deprecate execute (which takes a Request object) in favor of executeQuery and executeMutations which work directly with Query and Mutation objects. See updated Dgraph examples for how this drastically simplifies user code.
    • add EscapeRDF function and update examples, to properly escape string values in Nquad mutations
  • HTTP API improvements:
    • Add missing Bytes method for content, request, and response - to align with HTTP fetch API.
    • Use Uint8Array instead of ArrayBuffer where appropriate in AssemblyScript
    • Update Json method for content, request, and response to return an error instead of panicking, in Go.
  • OpenAI model API improvements:
    • Support direct passing of pre-encoded base64 strings for audio and image content, to avoid having to decode and re-encode the same data in certain cases.

Checklist

All PRs should check the following boxes:

  • I have given this PR a title using the
    Conventional Commits syntax, leading with fix:,
    feat:, chore:, ci:, etc.
    • The title should also be used for the commit message when the PR is squashed and merged.
  • I have formatted and linted my code with Trunk, per the instructions in
    the contributing guide.

If the PR includes a code change, then also check the following boxes. (If not, then delete the
next section.)

  • I have added an entry to the CHANGELOG.md file.
    • Add to the "UNRELEASED" section at the top of the file, creating one if it doesn't yet exist.
    • Be sure to include the link to this PR, and please sort the section numerically by PR number.
  • I have manually tested the new or modified code, and it appears to behave correctly.
  • I have added or updated unit tests where appropriate, if applicable.

@mattjohnsonpint mattjohnsonpint requested a review from a team as a code owner February 10, 2025 16:14
@mattjohnsonpint mattjohnsonpint merged commit d85eeec into main Feb 10, 2025
101 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3032-minor-api-improvements branch February 10, 2025 18:55
@mattjohnsonpint mattjohnsonpint restored the mjp/hyp-3032-minor-api-improvements branch February 10, 2025 18:57
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3032-minor-api-improvements branch February 10, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants