This file contains hidden or 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 json | |
| import subprocess | |
| from openai import OpenAI | |
| # Initialize OpenAI client | |
| client = OpenAI() | |
| # Custom tool: Format Python code using Black | |
| def format_code(code: str) -> dict: | |
| try: |
This file contains hidden or 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
| 1. Core Components to Include | |
| Incorporate these elements for each column (prioritize clarity and conciseness): | |
| A. Purpose (1–2 Sentences) | |
| What does the column represent? Use plain language, not technical jargon. | |
| Contextualize its role in the table. | |
| Example: | |
| "The order_status column indicates the current state of an order in the fulfillment process (e.g., pending, shipped, canceled). It is updated in real-time as the order progresses." |
This file contains hidden or 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
| from pyspark.sql import SparkSession | |
| from pyspark.sql.functions import col, count, countDistinct, regexp_extract | |
| from pyspark.sql.types import ( | |
| StructType, StructField, StringType, BooleanType, ArrayType, LongType, DoubleType | |
| ) | |
| # Initialize Spark session | |
| spark = SparkSession.builder.appName("MetadataExtractor").getOrCreate() | |
| # JDBC configuration for MS SQL Server (update with your connection details) |
This file contains hidden or 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
| Step-by-Step Instructions for Summarizing PDF Chunks for Improved Citation Retrieval and Query Similarity | |
| Objective: | |
| Create concise summaries of large PDF text chunks that retain critical information for both human readability and effective similarity matching during query retrieval. | |
| Optimize Summaries for Query Similarity | |
| Why: Ensure summaries retain terms/queries users might search for. | |
| Steps: | |
| Keyword Extraction: |
This file contains hidden or 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
| # Define your SQL query | |
| sql_query = """ | |
| SELECT name, age, salary | |
| FROM employees | |
| WHERE department = 'Sales' | |
| ORDER BY salary DESC; | |
| """ | |
| # Define the explanation for the SQL query | |
| explanation = "This query selects the names, ages, and salaries of all employees in the Sales department and orders them by their salaries in descending order." |
This file contains hidden or 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
| """working code | |
| - have to check the code on the ui side , what format are we getting | |
| """ | |
| import asyncio | |
| from fastapi import FastAPI, Response | |
| from fastapi.responses import StreamingResponse | |
| import json | |
| app = FastAPI() |
This file contains hidden or 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
| # Define Node Class | |
| class Node: | |
| def __init__(self, key, value): | |
| self.key = key | |
| self.value = value | |
| self.left = None | |
| self.right = None | |
| # Define Binary Index Tree Class | |
| class BinaryTree: |