Skip to content

Commit

Permalink
fix: prompt in LLMEvaluator (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
delamainer authored Nov 7, 2024
1 parent 7d2dfe8 commit b8093aa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }}

- name: Build
uses: docker/bake-action@v4
uses: docker/bake-action@v5
with:
set: |
*.cache-from=type=gha
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }}

- name: Load Image
uses: docker/bake-action@v4
uses: docker/bake-action@v5
with:
load: true
set: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.2-slim as runtime
FROM python:3.12.2-slim AS runtime

ENV PYTHONPATH=/app/
ENV RUNTIME_PACKAGES="git curl make"
Expand Down
29 changes: 15 additions & 14 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
version: "3.8"

x-base-app-test: &base-app-test
image: dynamiq-app:${IMAGE_TAG:-local}
build:
target: develop
volumes:
- ./:/app

services:
dynamiq-app:
# Caching target to avoid cache duplication
<<: *base-app-test
image: dynamiq-app:${IMAGE_TAG:-local}
build:
target: develop
volumes:
- ./:/app

dynamiq-app-test: &app-test
<<: *base-app-test
dynamiq-app-test:
image: dynamiq-app:${IMAGE_TAG:-local}
build:
target: develop
entrypoint: ["make", "test"]
env_file:
- .env
volumes:
- ./:/app

dynamiq-app-test-cov:
<<: *app-test
image: dynamiq-app:${IMAGE_TAG:-local}
build:
target: develop
entrypoint: ["make", "test-cov"]
env_file:
- .env
volumes:
- ./:/app
- ./reports:/app/reports:wr
3 changes: 2 additions & 1 deletion dynamiq/components/evaluators/llm_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def prepare_template(self) -> str:
return (
f"Instructions:\n"
f"{self.instructions}\n\n"
f"Generate the response in JSON format with the following keys:\n"
f"Generate the response in JSON format omit extra keys and markdown syntax elements, "
f"and include the following keys:\n"
f"{json.dumps(self.outputs)}\n"
f"Consider the instructions and the examples below to determine those values.\n\n"
f"Examples:\n"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "dynamiq"
version = "0.3.2"
version = "0.3.3"
description = "Dynamiq is an orchestration framework for agentic AI and LLM applications"
authors = ["Dynamiq Team <[email protected]>"]
license = "Apache License 2.0"
Expand Down

1 comment on commit b8093aa

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
dynamiq
   __init__.py30100% 
dynamiq/cache
   __init__.py10100% 
   codecs.py11281%16, 27
   config.py14192%34
   utils.py260100% 
dynamiq/cache/backends
   __init__.py20100% 
   base.py23578%34, 47, 59, 72, 84
   redis.py16475%20, 22, 48, 59
dynamiq/cache/managers
   __init__.py20100% 
   base.py39489%117–118, 120, 146
   workflow.py28292%73–74
dynamiq/callbacks
   __init__.py30100% 
   base.py491275%19, 31, 43, 79, 115, 132, 168, 187, 205, 209–210, 212
   streaming.py551572%96, 126–127, 135, 160–161, 169–174, 182, 190–191
   tracing.py169497%64, 120, 485, 507
dynamiq/clients
   __init__.py10100% 
   base.py8275%5, 21
dynamiq/components
   __init__.py00100% 
   serializers.py27966%25, 40, 58, 70, 101, 120, 122, 134, 136
dynamiq/components/converters
   __init__.py00100% 
   base.py491569%43, 48–50, 53–54, 61–62, 64–65, 98, 102, 107, 118, 122
   pptx.py34973%59–61, 66, 96–97, 101–102, 104
   pypdf.py602066%71–72, 77, 100–102, 125–135, 137–138, 140
   unstructured.py1164858%63, 69–70, 82–83, 90, 109, 143, 194–195, 200, 220–221, 228–229, 232, 259–260, 263, 283, 292–302, 304–305, 307, 312–325
   utils.py11463%23–25, 27
dynamiq/components/embedders
   __init__.py00100% 
   base.py71790%76, 80, 137–138, 159, 163, 167
   bedrock.py18477%19, 26–28
   cohere.py18288%21, 29
   huggingface.py10190%19
   mistral.py10190%19
   openai.py16287%44, 51
   watsonx.py10190%19
dynamiq/components/retrievers
   __init__.py00100% 
   chroma.py19289%33–34
   pinecone.py17288%34–35
   qdrant.py17288%31–32
   weaviate.py19289%31–32
dynamiq/components/splitters
   __init__.py00100% 
   document.py55787%60, 63, 83, 88, 97, 118, 124
dynamiq/connections
   __init__.py20100% 
   connections.py3354486%13–17, 99, 107, 118, 141, 528–529, 531–532, 536–537, 539–540, 553–554, 556, 584, 586, 598, 600–602, 643–644, 666–667, 673–675, 677–680, 682, 699–700, 737–738, 746, 854
   managers.py60591%70–71, 107, 167, 179
   storages.py14192%51
dynamiq/executors
   __init__.py00100% 
   base.py12283%35, 58
   pool.py601181%90, 111–112, 115, 163–164, 179, 192, 203–204, 215
dynamiq/flows
   __init__.py20100% 
   base.py25196%35
   flow.py1273175%68, 75, 82, 116, 159–161, 246–247, 249, 268–269, 271, 274, 293–294, 297–298, 301–302, 304–305, 308–310, 312–316, 318
dynamiq/loaders
   __init__.py00100% 
   yaml.py3009070%55, 58, 62–63, 66–69, 72, 97, 101, 112–113, 137–138, 157, 186, 213, 237, 240, 243, 246, 266–270, 273, 293–297, 300–301, 327–328, 333–334, 339–340, 382, 385–386, 397–400, 413–414, 452, 455, 458, 492, 496, 514–515, 599–600, 602–603, 607–610, 612, 617, 656, 659, 666, 674, 687–688, 720, 722, 725, 730, 757, 761, 765, 769–770, 823–824, 853, 902–906
dynamiq/memory
   __init__.py10100% 
   memory.py592852%17, 33–35, 50, 53, 56, 60–61, 67–77, 79, 83, 87–92
dynamiq/memory/backend
   __init__.py50100% 
   base.py19573%14, 19, 24, 29, 34
   in_memory.py704634%19–22, 26–27, 31, 35–39, 41–49, 51, 67–68, 76–81, 83–84, 88–89, 91–100, 104, 108
   pinecone.py765527%34–37, 39–40, 54–55, 57–58, 62, 71–73, 77–80, 82, 84–85, 89–94, 98–99, 101–106, 110–111, 113–115, 122–124, 132, 134–136, 140–143, 147–150
   qdrant.py856325%41–43, 45–46, 55–59, 63, 72–74, 85–88, 90, 93–94, 105–110, 123–127, 133–136, 138, 140–142, 146–147, 149–156, 158, 160–161, 165–170, 174–177
   sqlite.py1199421%50–51, 53–56, 60–61, 63–67, 69–71, 73, 75–76, 80–87, 91–96, 106, 108–109, 113–119, 124–125, 129–135, 137–138, 142–149, 153–156, 158–160, 162–164, 166–168, 171–173, 175–176, 178–182, 184–187, 189, 191–192, 194–195
dynamiq/nodes
   __init__.py20100% 
   exceptions.py15193%4
   managers.py12741%28–34
   node.py3314486%248, 259, 276, 281–282, 286–287, 310–311, 313, 328, 358, 360, 367–368, 568–570, 639–645, 647–652, 656, 658, 660, 830, 848, 856, 859, 877–879, 957, 982, 988
   types.py230100% 
dynamiq/nodes/agents
   __init__.py40100% 
   base.py2519960%82, 86–91, 97, 100–102, 128, 132, 157–158, 174, 189–190, 196–200, 220, 222–223, 226, 233–235, 239–240, 245–249, 251–252, 254–257, 269–270, 274–276, 282, 286–289, 291, 297–301, 303–304, 321–326, 332, 337, 370–371, 375–376, 380, 384, 388, 394–397, 401–403, 407, 409–410, 412–413, 415, 420–421, 428, 431, 435–436, 440–441, 445–446
   exceptions.py15380%7–8, 61
   react.py16412623%177, 226, 267–268, 272–274, 276–279, 287, 291–292, 294–295, 297, 300–302, 309, 329–330, 332–333, 339, 341, 343–349, 352, 364, 366–367, 371–372, 374–379, 383–387, 389, 391–393, 396–397, 399–402, 404, 407, 411–413, 416–417, 419–422, 424–431, 433–435, 437–440, 442, 446–447, 449, 451, 460–461, 466, 468–474, 478, 480, 488–491, 493, 497–499, 503, 505, 513–523, 525
   reflection.py362433%43–44, 47–48, 51, 64–66, 68–71, 73, 76–77, 80–81, 83–85, 87–90
   simple.py30100% 
dynamiq/nodes/audio
   __init__.py20100% 
   elevenlabs.py76692%39, 41, 89, 127, 172, 214
   whisper.py47882%46, 72, 79–80, 82, 108, 124, 126
dynamiq/nodes/converters
   __init__.py40100% 
   llm_text_extractor.py17312130%14, 49–53, 107–108, 114, 124, 132–134, 145–147, 175–177, 179, 187, 210–211, 213, 215–218, 225–226, 233–234, 236–239, 241–243, 245–246, 248–253, 255, 267, 269, 290, 292, 294–296, 298, 302, 326–327, 332, 334–335, 344, 348, 363, 370, 372–375, 389–390, 392–397, 410, 433–439, 442–443, 496, 498–500, 527–529, 531, 539, 562–563, 565, 567–570, 577–578, 585–586, 588–591, 593–594, 596–601, 603
   pptx.py31196%33
   pypdf.py32196%34
   unstructured.py39197%58
dynamiq/nodes/embedders
   __init__.py60100% 
   bedrock.py53296%48, 135
   cohere.py53296%48, 136
   huggingface.py53296%48, 137
   mistral.py53296%49, 137
   openai.py55296%53, 151
   watsonx.py53296%46, 130
dynamiq/nodes/llms
   __init__.py190100% 
   ai21.py9188%24
   anthropic.py8187%22
   anyscale.py9188%24
   azureai.py9188%24
   base.py104892%13, 173, 231–233, 235–237
   bedrock.py9188%24
   cerebras.py9188%24
   cohere.py8362%21–23
   custom_llm.py40100% 
   deepinfra.py9188%24
   gemini.py21195%43
   groq.py9188%24
   huggingface.py9188%24
   mistral.py9188%24
   openai.py8187%22
   replicate.py9188%24
   sambanova.py9366%23–25
   togetherai.py9188%24
   watsonx.py9188%24
dynamiq/nodes/operators
   __init__.py10100% 
   operators.py1444072%158, 174, 176, 178, 180, 184–191, 193, 219–220, 222–224, 226–229, 231, 233–236, 238, 242, 266, 284–288, 290, 292–293, 295
dynamiq/nodes/retrievers
   __init__.py40100% 
   chroma.py370100% 
   pinecone.py410100% 
   qdrant.py370100% 
   weaviate.py370100% 
dynamiq/nodes/splitters
   __init__.py10100% 
   document.py300100% 
dynamiq/nodes/tools
   __init__.py80100% 
   e2b_sandbox.py15511823%63, 77–78, 80–81, 113–115, 117, 127, 139–142, 146–151, 155–157, 161–163, 167–170, 172–173, 175, 177–178, 185, 187–188, 192–193, 196–201, 203, 208–209, 211, 215–219, 224, 228–235, 239–241, 245–246, 248–252, 256, 258–259, 261–262, 264–282, 288–290, 292–302, 304–305, 309–312
   firecrawl.py683647%59–60, 64–65, 73–74, 76, 82, 86–87, 89–92, 94, 105–106, 110–111, 117–120, 123, 125, 127–134, 138, 150, 152
   http_api_call.py47589%69, 81, 90, 99–100
   llm_summarizer.py552947%92–94, 100, 110, 122–124, 141–142, 148–151, 171–173, 175–176, 180–181, 186–188, 192–193, 195, 197, 201
   python.py511668%40–42, 81, 85–86, 149, 153–157, 173, 187–189
   scale_serp.py614427%56–57, 59–64, 66–67, 76, 91, 95–96, 98–100, 102–103, 107, 109, 111–112, 117–120, 123, 125, 127, 129–135, 137, 142–143, 151, 153, 160, 162
   tavily.py583343%78–86, 88, 104, 108–109, 111–112, 125, 127–128, 133–136, 139, 141, 143, 145, 149–150, 157–158, 161, 171, 173
   zenrows.py351945%50, 55–56, 58–60, 62, 67, 69, 74–77, 80, 82–83, 85–86, 88
dynamiq/nodes/utils
   __init__.py10100% 
   utils.py110100% 
dynamiq/nodes/validators
   __init__.py50100% 
   base.py22577%37–40, 45
   regex_match.py14192%37
   valid_choices.py9188%31
   valid_json.py10280%27–28
   valid_python.py8275%23–24
dynamiq/nodes/writers
   __init__.py40100% 
   chroma.py271062%37–39, 43, 47, 69–70, 72, 74–75
   pinecone.py40490%41, 54, 57, 60
   qdrant.py28196%38
   weaviate.py291162%38–40, 44, 48, 69–70, 72, 74–75, 77
dynamiq/prompts
   __init__.py10100% 
   prompts.py841582%98, 141, 154, 197–201, 206–207, 216–217, 221, 223, 230
dynamiq/runnables
   __init__.py10100% 
   base.py45197%145
dynamiq/storages
   __init__.py00100% 
dynamiq/storages/vector
   __init__.py40100% 
   base.py50100% 
   exceptions.py60100% 
   policies.py60100% 
   utils.py20100% 
dynamiq/storages/vector/chroma
   __init__.py10100% 
   chroma.py18614919%10–11, 56–57, 60, 71, 89–91, 94, 96, 98–99, 101–102, 104, 106, 117–119, 123–124, 128, 140–141, 143–144, 154–155, 176–177, 183–184, 192, 237–239, 241–244, 246, 248, 252, 261–262, 284–285, 288–289, 292, 294–295, 298–300, 302–304, 306, 308–315, 317–319, 321–323, 325–327, 329, 338–341, 343–358, 360–361, 363–364, 366, 382–384, 387, 389, 402–403, 407, 423–425, 427, 429–430, 432, 446–449, 451–454, 459–460, 462–463, 465–466, 468–469, 471, 485–488, 490–491, 496–497, 499–500, 502–503, 505–506
dynamiq/storages/vector/pinecone
   __init__.py10100% 
   filters.py958015%22–24, 26–28, 45–50, 52–53, 55–56, 58–59, 75, 78, 80–88, 93, 95, 97, 114–116, 120, 122, 139–141, 145, 147, 164–166, 170, 172, 189–191, 195, 197, 214–216, 220, 222, 239–241, 245, 247, 264–265, 268, 270–273, 277, 279, 296–298, 300–303, 307, 309
   pinecone.py1645964%17, 81–83, 117, 131, 143, 145–146, 148, 161–163, 170, 172, 190–192, 197, 201–202, 212–214, 216–217, 221, 233, 237, 243–244, 246–247, 257–258, 271–273, 275–277, 279–281, 283, 290, 292–293, 302–303, 306–308, 324–325, 354, 357, 396–397
dynamiq/storages/vector/qdrant
   __init__.py10100% 
   converters.py411368%26, 28–30, 32–35, 67–68, 70–71, 75
   filters.py1333375%61–62, 65–66, 80–81, 91–92, 99, 111, 177–178, 186–187, 217–218, 227, 233–234, 261–262, 277, 282–283, 288, 293–294, 299, 304–305, 310, 315–316
   qdrant.py2677571%29, 240, 256, 280, 284, 302–303, 306, 335–336, 339–340, 380–381, 445, 485, 518–519, 523, 525–528, 540, 544–549, 591–594, 596–597, 633–634, 638, 640, 642–643, 666–668, 670, 672, 688–689, 694, 747–748, 761, 763, 768–769, 777, 779–780, 785, 787–789, 791–792, 794–795, 801, 803–804, 810, 843, 845, 897–898
dynamiq/storages/vector/weaviate
   __init__.py10100% 
   filters.py12610516%22–24, 26–28, 56–63, 65, 87–92, 94–99, 101–105, 107–108, 121–126, 140–142, 156–157, 159, 178–184, 188–189, 206–212, 216–217, 234–240, 244–245, 262–268, 272–273, 290–292, 294, 311–315, 343, 345, 351, 353–360, 362, 377–378
   weaviate.py16512723%17–18, 57–59, 67–68, 70, 80–81, 90–91, 103–105, 107–108, 110–111, 113, 125–126, 128, 130–133, 135, 137–139, 141–145, 147–148, 150, 158, 160, 172–174, 177–180, 195, 197–200, 203–204, 211–216, 228–229, 231–232, 244–245, 249–251, 267–271, 273, 279–284, 286, 292, 294, 311–316, 318, 321, 323–324, 330–337, 352–353, 355, 368–371, 373–375, 386–387, 389, 398–399, 418–419, 429, 457–459, 461–462, 473
dynamiq/types
   __init__.py10100% 
   document.py160100% 
   streaming.py31390%48, 56, 84
dynamiq/utils
   __init__.py20100% 
   duration.py11190%45
   env.py80100% 
   jsonpath.py461469%18–19, 41, 43, 50–51, 55, 59–61, 84, 94–96
   logger.py100100% 
   utils.py60788%32, 34, 94–96, 148–149
dynamiq/workflow
   __init__.py10100% 
   workflow.py671774%15, 31, 34, 55, 57–58, 61–63, 65, 82–83, 86, 91–94
examples
   __init__.py00100% 
examples/rag
   __init__.py00100% 
   dag_yaml.py37878%65–67, 74–75, 81, 86, 88
   utils.py190100% 
tests
   __init__.py00100% 
   conftest.py78198%83
tests/integration
   __init__.py00100% 
tests/integration/flows
   __init__.py00100% 
tests/integration/nodes
   __init__.py00100% 
tests/integration/nodes/audio
   __init__.py00100% 
tests/integration/nodes/llms
   __init__.py00100% 
tests/integration/nodes/operators
   __init__.py00100% 
tests/integration/nodes/tools
   __init__.py00100% 
tests/integration/nodes/validators
   __init__.py00100% 
tests/integration_with_creds
   __init__.py00100% 
TOTAL7073223368% 

Tests Skipped Failures Errors Time
188 0 💤 0 ❌ 0 🔥 2m 48s ⏱️

Please sign in to comment.