From 19128186ace1919db4706928650bd45781e45f67 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Oct 2023 18:33:23 -0400 Subject: [PATCH 1/2] Specify useragent in call to WP API --- src/ontogpt/clients/wikipedia_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ontogpt/clients/wikipedia_client.py b/src/ontogpt/clients/wikipedia_client.py index 1e39f70d0..565e2702e 100644 --- a/src/ontogpt/clients/wikipedia_client.py +++ b/src/ontogpt/clients/wikipedia_client.py @@ -13,7 +13,7 @@ class WikipediaClient: def text(self, title: str) -> str: """Get the text of a an article.""" - wiki = wikipediaapi.Wikipedia(self.language) + wiki = wikipediaapi.Wikipedia("ontogpt", self.language) page = wiki.page(title) if page.exists(): From 7c4d42498f87b8d755382bd76e4e6ab9466bf08d Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 18 Oct 2023 18:38:03 -0400 Subject: [PATCH 2/2] Allow specification of model for wiki extract + search --- src/ontogpt/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ontogpt/cli.py b/src/ontogpt/cli.py index d1003f3c7..f723c917e 100644 --- a/src/ontogpt/cli.py +++ b/src/ontogpt/cli.py @@ -562,7 +562,7 @@ def wikipedia_extract(model, article, template, output, output_format, show_prom model_source = selectmodel["provider"] if model_source == "OpenAI": - ke = SPIRESEngine(template, **kwargs) + ke = SPIRESEngine(template=template, model=model, **kwargs) if settings.cache_db: ke.client.cache_db_path = settings.cache_db if settings.skip_annotators: @@ -603,7 +603,7 @@ def wikipedia_search(model, topic, keyword, template, output, output_format, sho model_source = selectmodel["provider"] if model_source == "OpenAI": - ke = SPIRESEngine(template, **kwargs) + ke = SPIRESEngine(template=template, model=model, **kwargs) elif model_source == "GPT4All": model_name = selectmodel["alternative_names"][0]