This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; $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]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <exception> | |
#include <memory> | |
#include <mutex> | |
#include <queue> | |
struct EmptyQueueException : std::exception { | |
const char * what() const throw() { | |
return "Empty queue"; | |
} | |
}; |
NewerOlder