Skip to content

Conversation

@kunal-vaishnavi
Copy link
Contributor

Description

This PR removes generating prompt templates and storing them in the GenAI config.

Motivation and Context

The prompt templates are not used internally anymore.

baijumeswani
baijumeswani previously approved these changes May 5, 2025
@baijumeswani
Copy link
Collaborator

Shall we remove the prompt processing code as well:

struct PromptTemplates_Element : JSON::Element {
explicit PromptTemplates_Element(std::optional<Config::Model::PromptTemplates>& v) : v_{v} {}
void OnValue(std::string_view name, JSON::Value value) override {
// if one of templates is given in json, then any non-specified template will be default "{Content}"
if (name == "assistant") {
EnsureAvailable();
v_->assistant = JSON::Get<std::string_view>(value);
} else if (name == "prompt") {
EnsureAvailable();
v_->prompt = JSON::Get<std::string_view>(value);
} else if (name == "system") {
EnsureAvailable();
v_->system = JSON::Get<std::string_view>(value);
} else if (name == "user") {
EnsureAvailable();
v_->user = JSON::Get<std::string_view>(value);
} else {
throw JSON::unknown_value_error{};
}
}
private:
std::optional<Config::Model::PromptTemplates>& v_;
void EnsureAvailable() {
if (!v_.has_value()) {
v_.emplace();
}
}
};

baijumeswani
baijumeswani previously approved these changes May 5, 2025
@kunal-vaishnavi kunal-vaishnavi merged commit c6ee481 into main May 5, 2025
14 of 15 checks passed
@kunal-vaishnavi kunal-vaishnavi deleted the kvaishnavi/prompt-templates branch May 5, 2025 21:00
RyanUnderhill pushed a commit that referenced this pull request May 6, 2025
### Description

This PR removes generating prompt templates and storing them in the
GenAI config.

### Motivation and Context

The prompt templates are not used internally anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants