AI endpoint -> url setting rename

This commit is contained in:
mdecimus 2024-10-13 09:59:03 +02:00
parent a4d93341da
commit 51ccdf0c03
4 changed files with 6 additions and 7 deletions

View file

@ -129,8 +129,8 @@ These are some of our open-source sponsors:
## Roadmap
- [ ] CalDAV, CardDAV and WebDAV support
- [ ] JMAP Calendar, Contacts and Tasks support
- [ ] CalDAV and CardDAV support
- [ ] ActiveSync support
See the [enhancement requests](https://github.com/stalwartlabs/mail-server/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement) page for a full list of proposed features by the community.
@ -139,7 +139,7 @@ See the [enhancement requests](https://github.com/stalwartlabs/mail-server/issue
Part of the development of this project was funded through the [NGI0 Entrust Fund](https://nlnet.nl/entrust), a fund established by [NLnet](https://nlnet.nl/) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
If you find the project useful you can help by [becoming a sponsor](https://liberapay.com/stalwartlabs). Thank you!
If you find the project useful you can help by [becoming a sponsor](https://opencollective.com/stalwart). Thank you!
## License

View file

@ -16,7 +16,7 @@ use utils::config::Config;
use crate::config::parse_http_headers;
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct AiApiConfig {
pub id: String,
pub api_type: ApiType,
@ -28,7 +28,7 @@ pub struct AiApiConfig {
pub default_temperature: f64,
}
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub enum ApiType {
ChatCompletion,
TextCompletion,
@ -199,7 +199,7 @@ impl AiApiConfig {
}
pub fn parse(config: &mut Config, id: &str) -> Option<Self> {
let url = config.value(("enterprise.ai", id, "endpoint"))?.to_string();
let url = config.value(("enterprise.ai", id, "url"))?.to_string();
let api_type = match config.value(("enterprise.ai", id, "type"))? {
"chat" => ApiType::ChatCompletion,
"text" => ApiType::TextCompletion,

View file

@ -728,7 +728,6 @@ impl Store {
#[cfg(feature = "test_mode")]
#[allow(unused_variables)]
pub async fn assert_is_empty(&self, blob_store: crate::BlobStore) {
use utils::codec::leb128::Leb128Iterator;

View file

@ -98,7 +98,7 @@ path = "{PATH}/test_antispam.db"
#url = "redis://127.0.0.1"
[enterprise.ai.dummy]
endpoint = "https://127.0.0.1:9090/v1/chat/completions"
url = "https://127.0.0.1:9090/v1/chat/completions"
type = "chat"
model = "gpt-dummy"
allow-invalid-certs = true