Skip to content

Instantly share code, notes, and snippets.

@shibanovp
shibanovp / README.md
Created October 25, 2024 09:14
shipzero

Task 1

From our clients we receive two files and imported the to a database:

  1. vehicles.csv → a list of trucks
  2. Trackings.csv → vehicle data with timestamp ("time") and position ("lat", "lng") • Consider and treat these files as if they were tables • Both tables can be matched via the vehicle_id. Please answer the following questions via a SQL script:
  3. Which vehicles are active/inactive (in the sense of having tracking data at all)? Result table with two columns: vehicle_id, active_Boolean
SELECT v.vehicle_id,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"name": "setup-chat",
"description": "the gist to setup Build your own AI-Powered chat app with Next.js and LangChain from blog.experienced.dev",
"version": "0.3.0",
"engines": {
"node": ">=18"
},
"bin": "./setup.js"
}
npx create-next-app@latest --ts --tailwind --experimental-app chat

cd chat

# https://github.com/debug-js/debug/issues/912
npm install -S langchain debug supports-color@^8.1.1

# Don't forget to set your API_KEY!
# .env  https://gist.github.com/shibanovp/2178a3e80d92d0ff2a9ce983b3c512ee
import { ChatOpenAI } from "langchain/chat_models/openai";
import { CallbackManager } from "langchain/callbacks";
import {
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
MessagesPlaceholder,
} from "langchain/prompts";
import { ConversationChain } from "langchain/chains";
import Chat from "./components/Chat";
export const metadata = {
title: "Chat with short-term memory",
};
export default function Home() {
return (
<main>
<Chat />