Skip to content

Instantly share code, notes, and snippets.

View izikeros's full-sized avatar

Krystian Safjan izikeros

View GitHub Profile
@izikeros
izikeros / ragas_azureopenai.py
Created April 11, 2024 08:05
[RAGAS AzureOpenAI boilerplate] #ragas #openai
"""
Requires the following environment variables (you can use it as .env_template):
COMPLETION_DEPLOYMENT_NAME=
EMBEDDING_DEPLOYMENT_NAME=
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_API_VERSION=
"""
@izikeros
izikeros / langchain_openai.py
Last active April 11, 2024 08:05
[Langchain OpenAI biolerplate] The small example that can be a test if RAGAS and openai are configured properly and both works #langchain #openai
"""Smoke test for the Azure OpenAI model from langchain_openai.
Check if the API is working as expected and all the required environment variables are set.
Requires the following environment variables (you can use it as .env_template):
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_API_VERSION=
AZURE_OPENAI_ENDPOINT=
COMPLETION_DEPLOYMENT_NAME=
"""
@izikeros
izikeros / azureopenai.py
Created April 11, 2024 08:02
[Azure OpenAI biolerplate] The small example that can be a test if openai is configured properly and works #openai
"""Smoke test for Azure OpenAI API.
Check if the API is working as expected and all the required environment variables are set.
Requires the following environment variables (you can use it as .env_template):
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_API_VERSION=
AZURE_OPENAI_ENDPOINT=
COMPLETION_DEPLOYMENT_NAME=
"""
@izikeros
izikeros / README.md
Created April 5, 2024 10:09
[release GitHub Action] #github #action

release GitHub Action

  • at 4:55 uses github action that analyse commits and creates versions
    • github.com/EddieHubCommunity/LinkFree/blob/main/.github/workflows/release.yml
@izikeros
izikeros / README.md
Last active April 5, 2024 04:05
[gitversion GitHub Action] GitHub action that support versioning for mono repo #github #action
@izikeros
izikeros / display_all_outputs_from_the_cell.ipynb
Last active March 27, 2024 17:23
[display out outputs from the cell] display out outputs from the cell instead of default last one #pandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@izikeros
izikeros / frontmatter.yaml
Last active May 7, 2024 07:56
[quarto notebook frontmatter] Frontmatter added to the first RAW cell in the notebook that define how to render report from the notebook #jupyter #notebook #quarto
---
title: 'Exploratory analysis'
author: 'Krystian Safjan'
date: '2024-01-03'
execute:
echo: false
format:
html:
toc: true
toc-depth: 5
@izikeros
izikeros / ruff.toml
Last active March 23, 2024 04:07
[ruff config] The sane configuration that expands default ruff config #ruff #ruff-config #qa #python #python-qa #configuration
exclude = [
".tox",
".git",
"docs",
"venv",
".venv",
"*.pyc",
".git",
"__pycache__",
]
@izikeros
izikeros / README.md
Last active March 14, 2024 09:51
[better branch] Display informative list of branches

Better branch

Script that display information about branches including branch description, sorted by most recently modified branch.

NOTE: to add or edit git branch description use: git branch --edit-description (or git branch develop --edit-description for specific branch - in this case develop branch)

Script inspierd by demo during the FOSDEM talk: https://youtu.be/aolI_Rz0ZqY?si=3nbEf8m2sKZDJRQU&t=468

better-branch

@izikeros
izikeros / configure_openai.py
Last active March 15, 2024 20:00
[azure openai config] Configure azure openai with data from .env file #openai #llm
import os
import openai
from dotenv import find_dotenv
from dotenv import load_dotenv
def configure_openai():
# Configure OpenAI using load dotenv and find .env file
env_file = find_dotenv()