Skip to content

Commit

Permalink
ais: remove ask*
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Dec 26, 2023
1 parent bd6c1d7 commit a6df1ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion kyo-llm/shared/src/main/scala/kyo/llm/agents/Vision.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object Vision extends Agent {
Question: ${input.question}
""",
s"data:image/jpeg;base64,$payload" :: Nil
).andThen(ai.ask)
).andThen(ai.gen[String])
}
}
}
Expand Down
31 changes: 0 additions & 31 deletions kyo-llm/shared/src/main/scala/kyo/llm/ais.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,6 @@ object ais {
def thought[T <: Thought](implicit j: Json[T], t: ClassTag[T]): Unit < AIs =
update(_.thought(Thought.info[T]))

def ask(msg: String): String < AIs =
userMessage(msg).andThen(ask)

def ask: String < AIs =
save.map { ctx =>
def eval(agents: Set[Agent]): String < AIs =
fetch(ctx, agents).map { r =>
r.calls match {
case Nil =>
r.content
case calls =>
Agents.handle(this, agents, calls)
.andThen {
Listeners.observe("Processing results") {
eval(agents)
}
}
}
}
Agents.get.map(eval)
}

def gen[T](msg: String)(implicit t: Json[T], f: Flat[T]): T < AIs =
userMessage(msg).andThen(gen[T])

Expand Down Expand Up @@ -202,9 +180,6 @@ object ais {
def run[T, S](v: T < (AIs with S))(implicit f: Flat[T < AIs with S]): T < (Requests with S) =
State.run[T, Requests with S](v).map(_._1)

def ask(msg: String): String < AIs =
init.map(_.ask(msg))

def gen[T](implicit t: Json[T], f: Flat[T]): T < AIs =
init.map(_.gen[T])

Expand All @@ -214,9 +189,6 @@ object ais {
def infer[T](msg: String)(implicit t: Json[T], f: Flat[T]): T < AIs =
init.map(_.infer[T](msg))

def ask(seed: String, msg: String): String < AIs =
init(seed).map(_.ask(msg))

def gen[T](seed: String, msg: String)(
implicit
t: Json[T],
Expand All @@ -231,9 +203,6 @@ object ais {
): T < AIs =
init(seed).map(_.infer[T](msg))

def ask(seed: String, reminder: String, msg: String): String < AIs =
init(seed, reminder).map(_.ask(msg))

def gen[T](seed: String, reminder: String, msg: String)(
implicit
t: Json[T],
Expand Down

0 comments on commit a6df1ee

Please sign in to comment.