Skip to content

Instantly share code, notes, and snippets.

View mark-mishyn's full-sized avatar

Mark Mishyn mark-mishyn

View GitHub Profile
@mark-mishyn
mark-mishyn / generate_function_json_schema.py
Last active September 21, 2024 10:27
Simple example of generation JSON Schema for OpenAI function_call with Python and Pydandic
import json
import openai
from pydantic import BaseModel, PrivateAttr
from src.common.config import Config
openai.api_key = Config.OPEN_AI_API_KEY
@mark-mishyn
mark-mishyn / sqs_long_polling.py
Created February 29, 2024 07:49
SQS messages processing using long polling, it a very lightweight alternative for Celery
import json
import threading
import boto3
from configurations.config_store import Config
from src.routes.frontapp.tasks import (
add_tags_to_conversation,
reply_to_front_message,
)