"""This is an example of how to use async langchain with fastapi and return a streaming response. | |
The latest version of Langchain has improved its compatibility with asynchronous FastAPI, | |
making it easier to implement streaming functionality in your applications. | |
""" | |
import asyncio | |
import os | |
from typing import AsyncIterable, Awaitable | |
import uvicorn | |
from dotenv import load_dotenv |
It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.
A number of things have happened since the last update.
#!/bin/bash | |
## Change following to '0' for output to be like ls and '1' for eza features | |
# Don't list implied . and .. by default with -a | |
dot=0 | |
# Show human readable file sizes by default | |
hru=1 | |
# Show file sizes in decimal (1KB=1000 bytes) as opposed to binary units (1KiB=1024 bytes) | |
meb=0 | |
# Don't show group column |
<?php | |
require_once('vendor/autoload.php'); | |
\Stripe\Stripe::setApiKey('sk_test_...'); | |
$session = \Stripe\Checkout\Session::create([ | |
'payment_method_types' => ['card'], | |
'line_items' => [[ | |
'price_data' => [ | |
'currency' => 'usd', |
There's quite a few libraries on npm that not only include the regular build in their package, but also a minified build. While this may seem like a helpful addition to make the package more complete, it actually poses a real problem: it becomes very difficult to audit these libraries.
You've probably seen incidents like the event-stream
incident, where a library was compromised in some way by an attacker. This sort of thing, also known as a "supply-chain attack", is starting to become more and more common - and it's something that developers need to protect themselves against.
One effective way to do so, is by auditing dependencies. Having at least a cursory look through every dependency in your dependency tree, to ensure that there's nothing sketchy in there. While it isn't going to be 100% perfect, it will detect most of these attacks - and no
Various search databases and backends as alternatives to Elasticsearch.
- Sonic - github.com/valeriansaliou/sonic - lightweight & schema-less search backend
- Tantivy - github.com/quickwit-oss/tantivy - full-text search engine library inspired by Apache Lucene
- Toshi - github.com/toshi-search/Toshi - search engine built on top of Tantivy
- Bayard - github.com/mosuka/bayard - search engine built on top of Tantivy
- Meilisearch - github.com/meilisearch/meilisearch - fast and full-featured search engine
#List of countries / Список стран
ISO 3166-1
En list forked from https://gist.github.com/396531
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
import os | |
from pathlib import Path | |
import requests | |
from requests.compat import urljoin |
Create the backend for a bootcamp directory website. The frontend/UI will be created by another team (future course). The html/css template has been created and can be used as a reference for functionality. All of the functionality below needs to be fully implmented in this project.
- List all bootcamps in the database
- Pagination
- Select specific fields in result
- Limit number of results
- Filter by fields