Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
changliu2 authored Jul 1, 2024
2 parents 85188c1 + 4450ec4 commit 02cdebb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/how-to-guides/quick-start.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Quick start

This guide will walk you through the fist step using of prompt flow code-first experience.
This guide will walk you through the first steps of the prompt flow code-first experience.

**Prerequisite** - To make the most of this tutorial, you'll need:
- Know how to program with Python :)
- Python programming knowledge

**Learning Objectives** - Upon completing this tutorial, you should learn how to:
**Learning Objectives** - Upon completing this tutorial, you should know how to:
- Setup your python environment to run prompt flow
- Create a flow using a prompt and python function
- Test the flow using your favorite experience: CLI, SDK or UI.
Expand All @@ -17,7 +17,7 @@ Install promptflow package to start.
pip install promptflow
```

Learn more on ways of [installation](./installation/index.md).
Learn more about [installation](./installation/index.md).

## Create your first flow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
try:
from ..._user_agent import USER_AGENT
except ImportError:
USER_AGENT = None


class CoherenceEvaluator:
Expand Down Expand Up @@ -43,6 +47,9 @@ def __init__(self, model_config: AzureOpenAIModelConfiguration):
model_config.api_version = "2024-02-15-preview"

prompty_model_config = {"configuration": model_config}
prompty_model_config.update({"parameters": {"extra_headers": {"x-ms-user-agent": USER_AGENT}}}) \
if USER_AGENT and isinstance(model_config, AzureOpenAIModelConfiguration) else None

current_dir = os.path.dirname(__file__)
prompty_path = os.path.join(current_dir, "coherence.prompty")
self._flow = load_flow(source=prompty_path, model=prompty_model_config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
try:
from ..._user_agent import USER_AGENT
except ImportError:
USER_AGENT = None


class FluencyEvaluator:
Expand Down Expand Up @@ -43,6 +47,8 @@ def __init__(self, model_config: AzureOpenAIModelConfiguration):
model_config.api_version = "2024-02-15-preview"

prompty_model_config = {"configuration": model_config}
prompty_model_config.update({"parameters": {"extra_headers": {"x-ms-user-agent": USER_AGENT}}}) \
if USER_AGENT and isinstance(model_config, AzureOpenAIModelConfiguration) else None
current_dir = os.path.dirname(__file__)
prompty_path = os.path.join(current_dir, "fluency.prompty")
self._flow = load_flow(source=prompty_path, model=prompty_model_config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
try:
from ..._user_agent import USER_AGENT
except ImportError:
USER_AGENT = None


class GroundednessEvaluator:
Expand Down Expand Up @@ -44,6 +48,10 @@ def __init__(self, model_config: AzureOpenAIModelConfiguration):
model_config.api_version = "2024-02-15-preview"

prompty_model_config = {"configuration": model_config}

prompty_model_config.update({"parameters": {"extra_headers": {"x-ms-user-agent": USER_AGENT}}}) \
if USER_AGENT and isinstance(model_config, AzureOpenAIModelConfiguration) else None

current_dir = os.path.dirname(__file__)
prompty_path = os.path.join(current_dir, "groundedness.prompty")
self._flow = load_flow(source=prompty_path, model=prompty_model_config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

from promptflow.client import load_flow
from promptflow.core import AzureOpenAIModelConfiguration
try:
from ..._user_agent import USER_AGENT
except ImportError:
USER_AGENT = None


class SimilarityEvaluator:
Expand Down Expand Up @@ -44,6 +48,8 @@ def __init__(self, model_config: AzureOpenAIModelConfiguration):
model_config.api_version = "2024-02-15-preview"

prompty_model_config = {"configuration": model_config}
prompty_model_config.update({"parameters": {"extra_headers": {"x-ms-user-agent": USER_AGENT}}}) \
if USER_AGENT and isinstance(model_config, AzureOpenAIModelConfiguration) else None
current_dir = os.path.dirname(__file__)
prompty_path = os.path.join(current_dir, "similarity.prompty")
self._flow = load_flow(source=prompty_path, model=prompty_model_config)
Expand Down

0 comments on commit 02cdebb

Please sign in to comment.