Add model alias configuration support and documentation #941
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.
Introduce support for model aliases, allowing users to define friendly names for models. Update documentation to reflect the new feature and provide examples for configuration.
📚 Documentation Enhancements:
model aliases
for better navigation and understanding.🆕 Feature Addition:
NodeHost
class, allowing for more flexible and organized alias configurations.🔧 Refactor:
setModelAlias
functionality into theNodeHost
class for better encapsulation and maintainability.🧪 Testing Configuration Updates:
TestHost
to support the newsetModelAlias
method for testing purposes.🗂️ Configuration File Update:
genaiscript.config.json
to demonstrate usage of the new alias system.Certainly! Below is a high-level summary of the key changes in the codebase based on the provided GIT_DIFF output:
Enhanced Configuration Flexibility: The addition of
modelAliases
in the global configuration file (genaiscript.config.json
) allows users to define custom aliases for language models. This makes it easier to reference specific models using concise names.Improved Model Configuration Details: When tracing connections to language models, detailed information now includes not only the model but also its configured temperature if applicable. This provides better visibility and control over how models are used in different scenarios.
API Update for TestHost: The
TestHost
class has been updated to include a method for setting model aliases, aligning with the new configuration schema.Validation of Configuration Format: By updating the JSON schema (
hostconfiguration.schema.json
), the system now validates the structure of the global configuration file, ensuring thatmodelAliases
are correctly formatted and can accept either simple string values or complex configurations.These changes aim to improve both usability (through clearer model references) and traceability (by providing more detailed information about model usage).