This example shows how to build an Agent having multiple agents as tools. This "Agent Team" works together to answer questions.
A more basic example can be found here
pip install git+https://github.com/neuml/txtai
This example shows how to build an Agent having multiple agents as tools. This "Agent Team" works together to answer questions.
A more basic example can be found here
pip install git+https://github.com/neuml/txtai
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module CheckStrictness where | |
import GHC.Generics |
The SalesForce CodeGen models are a family of large language models trained on a large amount of natural language data and then fine-tuned on specialized datasets of code. Models of size 350M, 2B, 6B, and 16B parameters are provided in three flavors:
ADD = lambda a: lambda b: \ | |
lambda f: lambda x: b(f)(a(f)(x)) | |
MULT = lambda a: lambda b: \ | |
lambda f: lambda x: a(b(f))(x) | |
ZERO = lambda f: lambda x: x | |
ONE = lambda f: lambda x: f(x) | |
TWO = ADD(ONE)(ONE) | |
THREE = ADD(ONE)(TWO) | |
FOUR = ADD(TWO)(TWO) |
This is a tutorial on the Curry-Howard correspondence, or the correspondence | |
between logic and type theory, written by Keith Pinson, who is still a learner | |
on this subject. If you find an error, please let me know. | |
This is a Bird-style literate Haskell file. Everything is a comment by default. | |
Lines of actual code start with `>`. I recommend that you view it in an editor | |
that understands such things (e.g. Emacs with `haskell-mode`). References will | |
also be made to Scala, for programmers less familiar with Haskell. | |
We will need to turn on some language extensions. This is not an essay on good |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Fizz where | |
import Protolude | |
fizzBuzz :: IO () | |
fizzBuzz = run fizzBuzzRules |
Monads and delimited control are very closely related, so it isn’t too hard to understand them in terms of one another. From a monadic point of view, the big idea is that if you have the computation m >>= f
, then f
is m
’s continuation. It’s the function that is called with m
’s result to continue execution after m
returns.
If you have a long chain of binds, the continuation is just the composition of all of them. So, for example, if you have
m >>= f >>= g >>= h
then the continuation of m
is f >=> g >=> h
. Likewise, the continuation of m >>= f
is g >=> h
.
%default total | |
||| A stream (an infinite list) of natural numbers representing the | |
||| fibbonacci sequence. | |
fibs : Stream Nat | |
fibs = f 0 1 | |
where | |
f : Nat -> Nat -> Stream Nat | |
f a b = a :: f b (a + b) |
-- in response to https://twitter.com/chrislpenner/status/1221784005156036608 | |
-- | |
-- The goal is to mimic this Scala code, but in Haskell: | |
-- | |
-- > "spotify:user:123:playlist:456" match { | |
-- > case s"spotify:user:$userId:playlist:$playlistId" | |
-- > => ($userId, $playlistId) // ("123", "456") | |
-- > } | |
{-# LANGUAGE DeriveFunctor, LambdaCase, PatternSynonyms, QuasiQuotes, RankNTypes, TemplateHaskell, TypeOperators, ViewPatterns #-} | |
{-# OPTIONS -Wno-name-shadowing #-} |