Skip to content

[CHORE] Make foundation api /init use correct schema, index, dim#7127

Merged
HammadB merged 4 commits into
mainfrom
hammad/foundation_api
May 26, 2026
Merged

[CHORE] Make foundation api /init use correct schema, index, dim#7127
HammadB merged 4 commits into
mainfrom
hammad/foundation_api

Conversation

@HammadB
Copy link
Copy Markdown
Collaborator

@HammadB HammadB commented May 25, 2026

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • init now uses correct schema, index and dim based on foundation settings.
  • New functionality
    • /

Test plan

How are these changes tested?
Added tests for new basic items of schema/collection creation/planning. The hardcoding of 1024 dim is untested.

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

None needed

Observability plan

No addtl needed

Documentation Changes

None

@github-actions
Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@blacksmith-sh

This comment has been minimized.

@HammadB HammadB requested a review from davedash May 25, 2026 19:17
@HammadB HammadB merged commit 8079330 into main May 26, 2026
117 of 121 checks passed
LLay added a commit that referenced this pull request May 26, 2026
Mirrors the CLI POC (chroma-core/foundation #97): after ensuring each
source collection, /init attaches the server-side function via
SysDb::create_attached_function, with the wiki collection as output.

- Attachment name `{source}_to_wiki`; operator `http_generate`
  (configurable); params carry the modal `endpoint_url`,
  `source_collection`, and `source_kind`.
- New FoundationConfig fields: function_name, function_endpoint_url,
  min_records_for_invocation (defaults mirror the POC + the chroma
  frontend's 100-record default). Output dimension is already hardcoded
  to 1024 in /init (chroma #7127), so no seed_output_collection step is
  needed.
- Idempotent: AlreadyExists / CollectionAlreadyHasFunction are treated
  as success so /init stays safe to call repeatedly.
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