forked from Shinonome/dots-hyprland
ai: gemini: allow searching
This commit is contained in:
@@ -299,14 +299,17 @@ class GeminiService extends Service {
|
|||||||
"generationConfig": {
|
"generationConfig": {
|
||||||
"temperature": this._temperature,
|
"temperature": this._temperature,
|
||||||
},
|
},
|
||||||
// "key": this._key,
|
"tools": [
|
||||||
// "apiKey": this._key,
|
{
|
||||||
|
"google_search": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
const proxyResolver = new Gio.SimpleProxyResolver({ 'default-proxy': userOptions.ai.proxyUrl });
|
const proxyResolver = new Gio.SimpleProxyResolver({ 'default-proxy': userOptions.ai.proxyUrl });
|
||||||
const session = new Soup.Session({ 'proxy-resolver': proxyResolver });
|
const session = new Soup.Session({ 'proxy-resolver': proxyResolver });
|
||||||
const message = new Soup.Message({
|
const message = new Soup.Message({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
uri: GLib.Uri.parse(replaceapidom(`https://generativelanguage.googleapis.com/v1/models/${this.modelName}:streamGenerateContent?key=${this._key}`), GLib.UriFlags.NONE),
|
uri: GLib.Uri.parse(replaceapidom(`https://generativelanguage.googleapis.com/v1beta/models/${this.modelName}:streamGenerateContent?key=${this._key}`), GLib.UriFlags.NONE),
|
||||||
});
|
});
|
||||||
message.request_headers.append('Content-Type', `application/json`);
|
message.request_headers.append('Content-Type', `application/json`);
|
||||||
message.set_request_body_from_bytes('application/json', new GLib.Bytes(JSON.stringify(body)));
|
message.set_request_body_from_bytes('application/json', new GLib.Bytes(JSON.stringify(body)));
|
||||||
|
|||||||
Reference in New Issue
Block a user