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 json | |
import logging | |
import os | |
from fastapi import FastAPI | |
from openai import BaseModel | |
from dotenv import load_dotenv | |
import os | |
from typing import Any | |
import openai |
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
CREATE OR REPLACE FUNCTION public.match_documents( | |
query_embedding vector, | |
match_threshold double precision, | |
match_count integer | |
) RETURNS TABLE( | |
id bigint, | |
content text, | |
similarity double precision, | |
metadata jsonb | |
) LANGUAGE sql STABLE AS $function$ |
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
fun TextView.setExpandableText(text: String, maxLines: Int, buttonsOnNewLines: Boolean = false) { | |
var layoutLaid = false | |
var layoutDisposable: Disposable? = null | |
setText(text) | |
post { | |
// If more than max lines are to be used for text, use "more-less" clickable | |
// labels in order to expand and collapse the text | |
if (lineCount > maxLines) { | |
// Temporarily set these values on the TextView. |
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
#!/usr/bin/env python | |
import sys | |
import requests | |
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import storage | |
image_url = sys.argv[1] #we pass the url as an argument | |
cred = credentials.Certificate('path/to/certificate.json') |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
String styleName = "StyleABC"; //Este nombre lo obtienes desde backend en alguna parte | |
int styleResourceId = getResources().getIdentifier(styleName, "style", getPackageName()); | |
setTheme(style); | |
} |