-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
069b3f0
commit 9760b34
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=}") |