A new WebSearch gramplet is ready

10 items will fit without side bar (sorry lateral is for french…). Only 8 items are displayed without scrolling when side bar is enabled. So, it is on my configuration. But to deal with width and height might be a challenge on the AI bloc area…

I thought it was related to the english prompt. So, you are right by disabling “non-french”.csv, we get all AI suggestions for FR! :tada:

I believe this is expected behavior. You receive top-10 suggestions which are sorted by relevance. So, you no need check to 10-th till you didn’t check the 1-st one. So, you can ignore all them and work as usual, or click one by one. If 1-st is not relevant you can just close this link. The closed link will not appear in the future. If suggested resource is relavent for you, you can add it to links-csv and the close it. Also the badges section has vertical scroll, you can try scroll them.

yes. you receive suggestions according to the regions, which are turned on in your settings (I mean CSV files)

The problem is also the size of the label (domain), the width seems too variable (I do not know the related Gtk widget and attribute). On the user side, to allow scrolling on a limited space is maybe not UI friendly. This is cosmetic for this testing, but on the first run, at least 2 items were splitten (not fully visible).

Its a compromise because first of all user is intrested in a space with links list. The AI suggestions section is secondary and I thing it should not use a lot of space. I can suggest only one source there. But I think this is better to have 10 than 1

1 Like

I should be able to use “Pixtral”?
The “self.model” list is not clear ( mistral-small-latest, mistral-ocr-latest, open-mistral-nemo, mistral-moderation-latest, mistral-large-latest, open-mixtral-8x7b,…)

I dont know about this because I dont use Pixtral, Mixtral and so on. I use OpenAI only. So, users are interested in Mistral supporting - I implemented it. But all others things are up to you - what AI sevice, what model, free or paid and so on. I can not help you in questions regarding your choice, tokens generating etc.

It is just because it has been noted as a free model. So, could be used on Media object…

It is something else…
By setting mistral-large-latest, we get:
:cross_mark: JSON Decode Error: Expecting value: line 1 column 1 (char 0)

So, the naming and return could be a problem according to the model set. Sure, to get a list of models matching our need, will be an improvement. That’s why I wanted to install mistralai (query on API) via python…

Others models (with valid names), could return something like:
:cross_mark: Error while calling Mistral API: 429 Client Error: Too Many Requests for url: https://api.mistral.ai/v1/chat/completions
:cross_mark: JSON Decode Error: Expecting property name enclosed in double quotes: line 2 column 4 (char 5)
etc.

Yes, thank you! :sports_medal:
As written, “mistral-small” model does the job too (without internet ‘update’). The “mistral-medium” could be more “up-to-date”. As for the Gramps Chat addon for 6.0.0, I just wonder where we should put the limit for gramps addons? I am not thinking on the creative stuff, rather around the privacy, efficiency, fact checking and so.

I think tokens can be limited (on mistral website) when you generate them.

I made tests for Mistral AI support into WebSearch gramplet, and statistics still ignore my requests… So, if the limit is not a “real time” limit, this could a problem.

I think Mistral support can answer. I dont know. As I said, I dont use Mistral

I am not certain that Mistral AI will answer about its counting limit (mistake) about token! I asked the AI anyway, and get:

1. Rate Limits: Each workspace on Mistral AI has preset rate limits, which can be based on the number of requests per second or the number of tokens per minute or per month. If you hit these limits, it’s possible that the tokens are not being properly accounted for or displayed in the statistics 3.
2. Quotas and Usage Limits: Mistral AI imposes quotas on the number of tokens you can use per minute and per month. For example, usage limits might include 1 request per second, 500,000 tokens per minute, and 1 billion tokens per month. Exceeding these quotas can affect how tokens are tracked and displayed 4.
3. API Errors: There are several errors you might encounter when using the Mistral AI API, such as 401 Unauthorized errors indicating a lack of valid authentication credentials. These errors can also affect how tokens are accounted for and displayed in the statistics 3.
4. Billing and Payment Activation: To fully utilize the features of the Mistral AI API, including token tracking, you need to activate payments on your account. If payments are not activated, some features, including token tracking, may not be available 5.

If you are experiencing specific issues with token tracking, it may be helpful to contact Mistral AI support for assistance and clarification.

Maybe my token tracking is disabled for API keys generated via “Experiment Plan”. So, something that I will not be able to … experiment for usage with gramplets!

This should be more tested… It leads to a segfault under my custom configuration (gramps 5.2.x, python 3.6).

Python : 3.6.9
Gtk++ : 3.22.30
pygobject : 3.26.1
Cairo : 1.15.10
pycairo : 1.16.2

2025-03-29 11:39:59.978: DEBUG: sqlite.py: line 135: ('SELECT blob_data FROM person WHERE handle = ?', ['fd863c910d17edab8f11b1a9bf2'])
2025-03-29 11:39:59.990: DEBUG: connectionpool.py: line 826: Starting new HTTPS connection (1): api.mistral.ai
2025-03-29 11:39:59.991: DEBUG: _gramplet.py: line 309: gramplet updater: WebSearch: running
2025-03-29 11:40:00.023: DEBUG: _gramplet.py: line 320: gramplet updater: WebSearch
2025-03-29 11:40:00.023: DEBUG: _gramplet.py: line 332: gramplet updater: WebSearch: return False
2025-03-29 11:40:03.689: DEBUG: connectionpool.py: line 396: https://api.mistral.ai:443 "POST /v1/chat/completions HTTP/1.1" 200 None
Erreur de segmentation

Also, maybe one should try to test this feature under Gramps 6.0?

Either on refresh populate_badges(domain_url_pairs) or something around remove_widget(widget) ?

I do not have a patch, but I know when it occurs.

def on_remove_badge(self, button, badge):
...
-> self.ui.boxes.badges.container.remove(badge)

I can not repro the issue. Did you change the Websearch source code?

No. But I guess it is related to my testing config…

Python : 3.6.9
Gtk++ : 3.22.30
pygobject : 3.26.1

Gramps v5.2 requires python 3.8 or greater and Gtk 3.24.

2 Likes