Skip to content

Commit

Permalink
✨ Add startup name generator
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Nov 26, 2023
1 parent 069b3f0 commit 9760b34
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions examples/ollama.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from langchain.chat_models import ChatOllama
from funcchain import chain, settings
from funcchain.streaming import stream_to
from pydantic import BaseModel


settings.LLM = ChatOllama(model="openhermes2.5-mistral", format="json")
settings.STREAMING = True


class Startup(BaseModel):
name: str
description: str
keywords: list[str]


def generate_startup_name(idea: str) -> Startup:
"""
Generate a startup concept based on the idea.
"""
return chain()


with stream_to(print):
idea = "AI coding assistant as cli tool"
startup = generate_startup_name(idea)

print(f"{startup.name=}")
print(f"{startup.description=}")

for keyword in startup.keywords:
print(f"{keyword=}")

0 comments on commit 9760b34

Please sign in to comment.