Based off https://gist.github.com/millerdev/547bac773483402554797e578fbd238f
export CONTAINER_NAME=open-chat-studio-db-1
export VOLUME_NAME=open-chat-studio_postgres_data
| """POC to illustrate remote tool calling in Langgraph using interrupts. | |
| Based on the example at https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/add-human-in-the-loop/#add-interrupts-to-any-tool | |
| export ANTHROPIC_API_KEY="..." | |
| export PG_CONNECTON_URL="postgres://postgres:postgres@localhost:5432/langgraph" | |
| python remote_tool.py "Book me a room at the Sheraton Hotel" | |
| python remote_tool.py --thread-id xxx --tool-response 'Hotel booking confirmed' | |
| """ | |
| import argparse |
Based off https://gist.github.com/millerdev/547bac773483402554797e578fbd238f
export CONTAINER_NAME=open-chat-studio-db-1
export VOLUME_NAME=open-chat-studio_postgres_data
| import uuid | |
| from typing import Generic, TypeVar | |
| from langchain_core.callbacks import CallbackManagerForChainRun | |
| from langchain_core.runnables import RunnableConfig | |
| from langchain_core.runnables.base import RunnableSerializable | |
| from langchain_core.runnables.utils import ConfigurableField | |
| T = TypeVar("T") |
| """ | |
| Demonstrate a method to create a pipeline that can handle dynamic splits in the pipeline based on the input type. | |
| """ | |
| import functools | |
| import operator | |
| from typing import Any | |
| from langchain_core.callbacks import CallbackManagerForChainRun | |
| from langchain_core.runnables import Runnable, RunnableConfig, RunnableLambda, RunnableSerializable, patch_config | |
| from langchain_core.runnables.base import RunnableEach |
| { | |
| "resourceType": "CapabilityStatement", | |
| "url": "https://www.commcarehq.org/a/<domain>/fhir/capability.json", | |
| "name": "CommCare <domain>", | |
| "title": "CommCare FHIR capability statement", | |
| "status": "draft", | |
| "date": "<dateTime>", | |
| "publisher": "Dimagi", | |
| "kind": "capability", | |
| "implementation": { |
| import os | |
| import csv | |
| import shutil | |
| import gzip | |
| from datetime import datetime, timedelta | |
| from collections import Counter | |
| from elasticsearch.exceptions import ConnectionTimeout | |
| from corehq.util.timezones.utils import parse_date | |
| from corehq.apps.es import FormES |
| import csv | |
| import shutil | |
| import gzip | |
| from collections import Counter | |
| from elasticsearch.exceptions import ConnectionTimeout | |
| from corehq.util.timezones.utils import parse_date | |
| path = '/home/cchq/form_dates' | |
| try: |
| ## | |
| # {{ ansible_managed }} | |
| # See https://github.com/dimagi/commcare-cloud/compare/sk/logstash?expand=1 | |
| filter { | |
| if [type] == "nginx-timing" { | |
| grok { | |
| match => [ | |
| "message", "\[%{HTTPDATE:http_timestamp}\] (?<cache_status>[-\w]+) %{WORD:http_method} %{DATA:request} HTTP/%{NUMBER:httpversion} %{NUMBER:status_code} %{NUMBER:request_time}" | |
| ] |
| @module mod-python | |
| @define logpath "/home/cchq/www/{{ deploy_env }}/logs" | |
| @define environment "{{ env_monitoring_id }}" | |
| @define statsd_host "{{ datadog_statsd_host|default('localhost') }}" | |
| @define statsd_port "{{ datadog_statsd_port|default(8125) }}" | |
| source src { | |
| file("`logpath`/{{ deploy_env }}-timing.log" follow-freq(1) flags(no-parse)); | |
| }; |
| # Load and parse CSV logs from PostgreSQL | |
| import os | |
| import re | |
| import sys | |
| import postgres_copy | |
| import six | |
| import sqlalchemy |