Skip to content

Instantly share code, notes, and snippets.

View sebington's full-sized avatar

sebington sebington

  • University of Western Brittany
  • Brest, France
  • 16:08 (UTC -12:00)
View GitHub Profile
@sebington
sebington / groq_language_detector.py
Last active October 30, 2025 10:51
Sends a character chain to a Groq model and retrieves the corresponding RFC 5646 language code (Groq API key needed)
import os
import json
from groq import Groq
def get_language_code(text: str, api_key: str = None) -> str:
"""
Identify the RFC 5646 language code of given text using Groq API.
Args:
text: The text to identify
@sebington
sebington / MiraGroq.py
Last active December 18, 2025 20:47
This is a slightly modified version of the DiVeRSe (Diverse Verifier on Reasoning Steps) technique using LLMs with Mirascope. DiVeRSe is a prompt engineering method that enhances an LLM's reasoning capabilities by generating multiple reasoning chains from variations of the original prompt. All steps of the script are printed on screen.
# from https://mirascope.com/docs/mirascope/guides/prompt-engineering/chaining-based/diverse
# adapted for Groq by Claude (web version)
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "mirascope[groq]",
# "pydantic>=2.0",
# ]
# ///