Quickstart
Create and Export API Key
export GOLEAN_API_KEY="your_api_key_here"Make your first GoLean API Request
pip install goleanfrom golean import GoLean
# Initialize the GoLean client
golean = GoLean(api_key=os.getenv("GOLEAN_API_KEY"))
# Compress template and data
result = golean.compress_with_template(
template="""Read the passage, then answer the question. Only output the exact answer without any extra word or punctuation.
Passage: {context}
Question: {question}""",
data={
"context": "A large language model (LLM) is a type of computational model designed for natural language processing tasks such as language generation. As language models, LLMs acquire these abilities by learning statistical relationships from vast amounts of text during a self-supervised and semi-supervised training process." ,
"question": "name an example task the LLM is designed for"
}
)
print("Compressed Result:", result)Last updated