Skip to main content
Glama

Documentation Retrieval & Web Scraping

by AIwithhassan
utils.py859 B
import trafilatura import os from dotenv import load_dotenv from groq import Groq load_dotenv() def clean_html_to_txt(html): try: extracted = trafilatura.extract( html, include_comments=False, include_tables=False, favor_recall=False, ) if extracted: return extracted except Exception as e: raise e def get_response_from_llm(user_prompt, system_prompt, model): api_key = os.getenv("GROQ_API_KEY") groq_client = Groq(api_key=api_key) chat_completion = groq_client.chat.completions.create( messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], model=model, ) return chat_completion.choices[0].message.content

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIwithhassan/mcp-server-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server