Commit graph

22 commits

Author SHA1 Message Date
db19c4f4f8 Add Logs 2025-07-24 10:05:48 +02:00
cf88959576 Update query parameters and response handling in server.py
Replaced hardcoded date values with environment variables for flexibility and added a new filter for newspapers. Enhanced response parsing by including facets for related persons and organizations.
2025-07-03 23:33:12 +02:00
e5a6c59f7a Add execution time logging to smd_detail_article function
Introduced performance tracking in the smd_detail_article function by adding execution time logging. This helps in monitoring and optimizing the function’s runtime during API requests and processing.
2025-06-21 22:22:21 +02:00
bbec6df3fd Refactor response handling to parse JSON content.
Replace raw response text retrieval with JSON parsing to extract specific content. This ensures more precise data handling and aligns with expected response structure.
2025-06-21 22:19:50 +02:00
4c554b1472 Fix incorrect API key header in summarization function
The "Bearer" prefix was mistakenly included in the API key header. This change removes it to align with the expected format required by the external service.
2025-06-21 21:57:17 +02:00
cfc124915f Fix incorrect string formatting for model payload key
Replaced curly brackets with direct reference to the environment variable in the payload model value. This ensures the correct model is passed dynamically from environment configurations.
2025-06-21 21:54:29 +02:00
5799319ade Update response handling and add summarized content return
Modified the response handling to return raw text instead of JSON in one case and updated another to include summarized content with article ID. These changes ensure consistency and enhance the response structure for better client integration.
2025-06-21 21:47:13 +02:00
0d532d147b Simplify server response handling by returning raw data.
Replaced the summarized content processing with direct data return. This improves efficiency by skipping the summarization step and ensures the full response data is available to the caller for further use.
2025-06-21 21:43:51 +02:00
6f9f74dae0 Refactor summarize_to_words to accept text and title.
Updated the `summarize_to_words` function to take `text` and `title` as separate parameters instead of a single `article` dictionary. Adjusted payload and function calls accordingly for better clarity and flexibility.
2025-06-21 21:35:54 +02:00
1d5aeb1644 Add article summarization via external API integration
Introduced a new `summarize_to_words` function to summarize articles using an external API. Integrated it into `smd_detail_article` to return summarized article content instead of the full text. Updated header key capitalization for consistency.
2025-06-21 21:18:32 +02:00
3c1f8a2c25 Optimize query formulation instructions in docstring
Clarified that the SMD search query should be written in German and enriched with relevant contextual keywords. This ensures better alignment with language requirements and improves search accuracy.
2025-06-21 20:52:00 +02:00
25000459cb Set default page size from environment variable
Replaced the hardcoded page size with a value fetched from the `SWISSDOX_PAGESIZE` environment variable, defaulting to 10 if not set. This allows greater flexibility and configurability for pagination settings.
2025-06-21 20:39:22 +02:00
87d4884eea Switch HTTP method from GET to POST in server request.
Updated the SMD server client to use POST instead of GET for sending requests. This change ensures the payload is sent as JSON in compliance with the server's expected input format.
2025-06-21 20:25:52 +02:00
8eda903185 Switch to aiohttp for async HTTP requests in server logic
Replaced synchronous requests with aiohttp to enable non-blocking, async HTTP requests. Updated `smd_detail_article` and `smd_research` to utilize asyncio for parallel execution, significantly improving efficiency for handling multiple API calls. Added aiohttp and asyncio dependencies to requirements.txt.
2025-06-21 20:17:59 +02:00
1554d5e4ab Update article query logic and improve response structure
Removed the unused `smd_detail_article` decorator and expanded the response structure to include detailed article data in nested JSON. Adjusted the pagination default `pageSize` from 10 to 25 to handle larger datasets effectively.
2025-06-21 20:06:17 +02:00
d779b5bd98 Update SMD server to fix API URL and clarify docstring
Revised the API endpoint URL from smd.ch to swissdox.ch for accuracy and updated the function docstring to clarify the purpose of the article_id parameter. These changes improve clarity and ensure API requests are routed correctly.
2025-06-21 19:50:27 +02:00
4793aca10e Update docstring for smd_detail_article function
Clarify the usage instructions and context for the smd_detail_article function. This ensures better understanding of its relationship with the smd_research tool.
2025-06-21 19:35:33 +02:00
a36990856c Update default onlyResults parameter to False
The `onlyResults` parameter was changed from `True` to `False` in the API request configuration. This ensures more comprehensive data retrieval by including additional metadata in the API response.
2025-06-21 19:31:05 +02:00
bf695bef09 Refactor SMD utilities and streamline research query usage
Remove unnecessary SMD utilities and shift query creation logic directly into `smd_research` for simplicity. This eliminates duplicate functionality and reduces reliance on external utility files, consolidating responsibilities within server implementation.
2025-06-21 19:14:11 +02:00
ba48f44321 Set keep-alive timeout for FastMCP servers to 720 seconds
Added the `timeout_keep_alive` parameter to FastMCP initialization in both GPT Researcher and SMD Researcher servers. This ensures connections remain active for longer, improving server reliability for long-lived client interactions.
2025-05-31 22:29:01 +02:00
12503a4453 Set FastMCP server to listen on all interfaces with port 8000
The `host` and `port` parameters were added to FastMCP initialization for both GPT Researcher and SMD servers. This ensures the servers are accessible on all network interfaces at port 8000.
2025-05-31 21:16:40 +02:00
3b75d04f32 Add SMD MCP Server implementation and utilities
Implemented the SMD MCP Server with functionality for AI-driven research and article retrieval via the MCP protocol. Added utilities for prompt creation and enhanced dependency configuration. This serves as a foundation for handling SMD-related queries and data processing.
2025-05-31 17:08:46 +02:00