Added company name to model list
This commit is contained in:
parent
c7ca2bc4a0
commit
5b7c4988d4
19
Chat.go
19
Chat.go
@ -753,7 +753,24 @@ func GenerateModelPopoverHTML(refresh bool, c *fiber.Ctx) string {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
modelInfos := GetAvailableModels(c)
|
||||
var modelInfos []ModelInfo
|
||||
err = edgeGlobalClient.WithGlobals(map[string]interface{}{"ext::auth::client_token": c.Cookies("jade-edgedb-auth-token")}).Query(edgeCtx, `
|
||||
SELECT ModelInfo {
|
||||
modelID,
|
||||
name,
|
||||
company : {
|
||||
name,
|
||||
icon
|
||||
}
|
||||
}
|
||||
FILTER .modelID != 'none' AND .company.name != 'huggingface' AND .company IN global currentUser.setting.keys.company
|
||||
ORDER BY .company.name ASC THEN .name ASC
|
||||
`, &modelInfos)
|
||||
if err != nil {
|
||||
fmt.Println("Error getting models")
|
||||
panic(err)
|
||||
}
|
||||
|
||||
isPremium, isBasic := IsCurrentUserSubscribed(c)
|
||||
|
||||
out, err := modelPopoverTmpl.Execute(pongo2.Context{
|
||||
|
21
MyUtils.go
21
MyUtils.go
@ -231,24 +231,3 @@ func Message2RequestMessage(messages []Message, context string) []RequestMessage
|
||||
return m
|
||||
}
|
||||
}
|
||||
|
||||
func GetAvailableModels(c *fiber.Ctx) []ModelInfo {
|
||||
var models []ModelInfo
|
||||
err := edgeGlobalClient.WithGlobals(map[string]interface{}{"ext::auth::client_token": c.Cookies("jade-edgedb-auth-token")}).Query(edgeCtx, `
|
||||
SELECT ModelInfo {
|
||||
modelID,
|
||||
name,
|
||||
company : {
|
||||
name,
|
||||
icon
|
||||
}
|
||||
}
|
||||
FILTER .modelID != 'none' AND .company.name != 'huggingface' AND .company IN global currentUser.setting.keys.company
|
||||
ORDER BY .company.name ASC THEN .name ASC
|
||||
`, &models)
|
||||
if err != nil {
|
||||
fmt.Println("Error getting models")
|
||||
panic(err)
|
||||
}
|
||||
return models
|
||||
}
|
||||
|
@ -48,7 +48,7 @@
|
||||
<div class="select is-fullwidth is-small mb-3" id="model-id-input">
|
||||
<select name="selectedLLMId">
|
||||
{% for modelInfo in ModelInfos %}
|
||||
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.Name }}</option>
|
||||
<option value="{{ modelInfo.ModelID }}">{{ modelInfo.Company.Name }} - {{ modelInfo.Name }}</option>
|
||||
{% endfor %}
|
||||
<option value="{% if IsSub %}custom{% else %}none{% endif %}">Inference Endpoints</option>
|
||||
</select>
|
||||
|
Loading…
x
Reference in New Issue
Block a user