Skip to content

Instantly share code, notes, and snippets.

View pchalasani's full-sized avatar

Prasad Chalasani pchalasani

View GitHub Profile
@pchalasani
pchalasani / file_assistant.py
Last active November 8, 2025 23:03
m10 code assignment: file_assistant.py
"""
Task 1-2 Part 2: File Assistant Agent
Create an agent that can use the file tools to perform operations
based on natural language requests. This agent will interpret user
intent and use the appropriate tools.
Complete the TODOs below to implement the file assistant.
"""
@pchalasani
pchalasani / llm-agent.html
Created July 20, 2025 19:41
html logs of langroid agent loop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="2">
<title>LLM-Agent - Langroid Task Log</title>
<style>
body {
background-color: #1e1e1e;
@pchalasani
pchalasani / langroid-simple-web-search.md
Created February 1, 2025 16:41
Langroid: simple web search

Run like this from the langroid repo:

uv run examples/basic/chat-search.py -m groq/deepseek-r1-distill-llama-70b

Example screenshot:

image
@pchalasani
pchalasani / langroid-function-calling.md
Created January 31, 2025 14:19
Langroid function-calling example

Run like this from the langroid-examples repo after setting up the env

uv run examples/basic/tool-extract-short-example.py -m ollama/mistral-small

Sample output:

image
@pchalasani
pchalasani / langroid-RAG-citations.md
Last active January 24, 2025 13:54
Langroid document-chat (RAG) citations example

Install Langroid and run this doc-chat example script from the examples/ folder:

uv run examples/docqa/chat.py https://arxiv.org/pdf/2501.12948

Example output:

@pchalasani
pchalasani / bsky-atproto-example.py
Created November 24, 2024 22:44
get bluesky data via python client lib "atproto"
# Simple example of getting bsky data via `atproto` python client
#
# First install: atproto, python-dotenv
# See python client docs here:
# https://github.com/MarshalX/atproto
#
from atproto import Client, IdResolver
import os
@pchalasani
pchalasani / settings.json
Last active December 9, 2024 12:51
zed config
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
// The settings for slash commands.
@pchalasani
pchalasani / chainlit-nested-ask.py
Created February 3, 2024 17:45
Chainlit: Trying to nest AskUserMessage under a step
from typing import Any, Callable, cast, Optional, Union
import textwrap
import chainlit as cl
from datetime import datetime
from chainlit.sync import run_sync
from chainlit.message import AskMessageBase, AskUserMessage, MessageStepType
from chainlit.types import AskSpec
from chainlit.step import StepDict
from chainlit.config import config
from chainlit.telemetry import trace_event
/Users/pchalasani/Git/langroid-examples/.venv/lib/python3.11/site-packages/langroid/parsing/docu │
│ ment_parser.py:301 in iterate_pages │
│ │
│ 298 │ def iterate_pages(self) -> Generator[Tuple[int, Any], None, None]: # type: ignore │
│ 299 │ │ from unstructured.partition.pdf import partition_pdf │
│ 300 │ │ │
│ ❱ 301 │ │ elements = partition_pdf(file=self.doc_bytes, include_page_breaks=True) │
│ 302 │ │ for i, el in enumerate(elements): │
│ 303 │ │ │ yield i, el │
│ 304 │
@pchalasani
pchalasani / arb-bot.py
Created April 17, 2022 21:30
Example using blankly add_arbitrage_event
import blankly
from blankly import StrategyState
import numpy as np
def trade(state: StrategyState):
'''
Example of how to decide a trade based on ALL assets
'''
symbols = state.symbol