Skip to content

Commit

Permalink
azure example for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jun 15, 2024
1 parent 38dcee4 commit f6e3f6b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/models/azure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from funcchain import chain, settings
from pydantic import BaseModel, Field


# define your model
class SentimentAnalysis(BaseModel):
analysis: str = Field(description="A description of the analysis")
sentiment: bool = Field(description="True for Happy, False for Sad")


# define your prompt
def analyze(text: str) -> SentimentAnalysis:
"""
Determines the sentiment of the text.
"""
return chain()


if __name__ == "__main__":
# set global llm
settings.llm = "azure/gpt-4o"
# log tokens as stream to console
settings.console_stream = True

# run prompt
poem = analyze("I really like when my dog does a trick!")

# show final parsed output
print(poem)

0 comments on commit f6e3f6b

Please sign in to comment.