Skip to content

Instantly share code, notes, and snippets.

View deepanshululla's full-sized avatar
👋
holla

Deepanshu Lulla deepanshululla

👋
holla
View GitHub Profile
import litellm
from litellm.assistants.main import create_thread, add_message, run_thread
from litellm.types.llms.openai import Attachment
from openai.types.beta.threads.message_create_params import AttachmentToolFileSearch
API_KEY = ""
BASE_URL = "https://dev-shared-llmgateway.dev.billdot.io"
# litellm.api_key = API_KEY
import os
from openai import OpenAI
from openai.types.beta.threads.message_create_params import AttachmentToolFileSearch, Attachment
def completion(client, filename, prompt, assistant_id):
# Create thread
thread = client.beta.threads.create()
import selectors
import socket
import types
class ServerWithSelect:
def __init__(self, host_name="localhost", port_num=6379, reuse_port=True):
self.host_name = host_name
self.port_num = port_num
self.reuse_port = reuse_port
import socket
import threading
class ThreadedServer:
def __init__(self, host_name="localhost", port_num=6379, reuse_port=True):
self.host_name = host_name
self.port_num = port_num
self.reuse_port = reuse_port
self.init_server()
import asyncio
import socket
from asyncio import AbstractEventLoop
class AsyncSocketServer:
def __init__(self, host_name="localhost", port_num=6379, reuse_port=True):
self.host_name = host_name
self.port_num = port_num
self.reuse_port = reuse_port
import asyncio
class AsyncIOServer:
def __init__(self, host_name="localhost", port_num=6379, reuse_port=True):
self.host_name = host_name
self.port_num = port_num
self.reuse_port = reuse_port
async def __start_server(self):
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
(setq user-full-name "Deepanshu lulla"
user-mail-address "[email protected]")
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
#include <iostream>
#include <string>
template <class T>
class Array2D {
public:
Array2D(int dim1, int dim2) :d_container(new Array1D(dim1)) {
for (int i=0; i< dim1; ++i) {
Array1D array1(dim2);
@deepanshululla
deepanshululla / thread_safe_queue.cpp
Last active April 27, 2022 09:42
thread_safe_queue.cpp
#include <exception>
#include <memory>
#include <mutex>
#include <queue>
struct EmptyQueueException : std::exception {
const char * what() const throw() {
return "Empty queue";
}
};