Skip to content

Instantly share code, notes, and snippets.

@hansvdam
hansvdam / convert_directory.py
Last active October 26, 2024 19:26
fotos van bonnentjes hernoemen met AI
import base64
import os
import openpyxl
from langchain.chains.transform import TransformChain
from langchain_community.chat_models import ChatOpenAI
from langchain_core.messages import HumanMessage
from openai.types import image_model
from pathlib import Path
from openpyxl.styles import PatternFill
from openpyxl.utils import get_column_letter
@hansvdam
hansvdam / main.dart
Created September 20, 2024 11:43
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@hansvdam
hansvdam / main.dart
Created August 12, 2024 15:03
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@hansvdam
hansvdam / main.dart
Created August 12, 2024 15:02
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget
@hansvdam
hansvdam / main.dart
Created August 12, 2024 14:56
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@hansvdam
hansvdam / gist:24f4bf6281a7177d7390d59ee169cb04
Created February 18, 2024 12:30
function calling tools for langbar using Trelis models
[
{
"type": "function",
"function": {
"name": "creditcard",
"description": "Show your credit card and maybe perform an action on it",
"parameters": {
"type": "object",
"properties": {
"limit": {
@hansvdam
hansvdam / gist:8b9269390e16fa0bf394d7656bec1ea5
Last active October 31, 2024 01:21
sample openai curl with function calling
curl --location 'https://api.openai.com/v1/chat/completions' \
--header 'Content-Type: application/json' \
-u :$OPENAI_API_KEY \
--data '{
"messages": [
{
"role": "system",
"content": "The current date and time is 2023-07-22T13:57:34+02:00. Be very presumptive when guessing the values of function parameters."
},
{
@hansvdam
hansvdam / gist:193b1a2ef2415825b33ed2800876cc51
Created July 20, 2023 11:30
openai function calling prompt for train trip planning
{
"messages": [
{
"role": "system",
"content": "The current date and time is 2023-07-20T13:25:20+02:00. Be very assumptive when guessing the values of function parameters."
},
{
"role": "user",
"content": "am ut 6"
}