feat(shared): add moonshot model family support#2430
Open
narcilee7 wants to merge 1 commit into
Open
Conversation
Add support for Moonshot AI (Kimi) vision models: - Add 'moonshot' to TModelFamily and MODEL_FAMILY_VALUES - Add MIDSCENE_USE_MOONSHOT legacy env variable - Add unit tests for model family validation and config parsing Moonshot API is OpenAI-compatible, so it reuses the existing VLM calling chain with standard 0-1000 normalized bbox coordinates. Validation: - pnpm run lint - npx nx test @midscene/shared - npx nx test @midscene/core
|
@narcilee7 大佬请问一下,增加了配置后,具体效果怎么样?我本次运行试了一下,基本识别不到呢,还需要配置别的什么吗 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add support for Moonshot AI (Kimi) vision models in Midscene.js.
Changes
moonshottoTModelFamilytype andMODEL_FAMILY_VALUESarrayMIDSCENE_USE_MOONSHOTlegacy environment variable for quick configurationmoonshotmapping inlegacyConfigToModelFamilyWhy
Moonshot API is fully OpenAI-compatible, so it can reuse Midscene's existing VLM calling chain. However, registering it as a first-class
modelFamilyensures:modelFamilyis set, the planning prompt correctly describes thelocateparam as{bbox: [xmin, ymin, xmax, ymax], prompt: string}, allowing the model to return coordinates directly in the planning phase.{prompt: string}, forcing a separate locate call afterward.MIDSCENE_MODEL_FAMILY=moonshotorMIDSCENE_USE_MOONSHOT=1.Usage
Or via legacy flag:
Validation
pnpm run lintnpx nx test @midscene/shared(325 passed)npx nx test @midscene/core(817 passed)