Skip to content

Instantly share code, notes, and snippets.

@psyho
psyho / cli_builder.rb
Created September 1, 2016 17:12
CLI builder example
module HashConstructor
def initialize(attrs = {})
attrs.each do |name, value|
send("#{name}=", value)
end
end
end
class AwsCli
include HashConstructor
[
{
"insertId": "qzv45vopsusy6nv1",
"jsonPayload": {
"fields": {
"message": "Apollo Router v1.4.0 // (c) Apollo Graph, Inc. // Licensed as ELv2 (https://go.apollo.dev/elv2)"
},
"target": "apollo_router::executable",
"level": "INFO",
"timestamp": "2022-11-28T09:34:46.032103Z"
#!/usr/bin/env python
from llama_index.core.agent import AgentRunner
from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.core.tools import FunctionTool
from llama_index.llms.openai import OpenAI
def weather_tool(city: str):
"""