Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rawResponse -> raw_response for snake_case consistency #657

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

rholinshead
Copy link
Contributor

@rholinshead rholinshead commented Dec 28, 2023

rawResponse -> raw_response for snake_case consistency

Just updating the rawResponse property name to raw_response for snake_case consistency in the schema. All other changes here are just auto-formatted

Testing

pytest

=========================================================== 88 passed, 38 warnings in 3.28s ===========================================================

yarn test

(aiconfig) ryanholinshead@Ryans-MBP typescript % yarn test 
yarn run v1.22.19
$ jest --runInBand
 PASS  __tests__/parsers/hf/hf.test.ts
  HuggingFaceTextGeneration ModelParser
    ✓ uses HuggingFace API token from environment variable if it exists (9 ms)
    ✓ serializing params to config prompt (1 ms)
    ✓ serialize callbacks (1 ms)
    ✓ deserializing config prompt to params (1 ms)
    ✓ deserialize callbacks (1 ms)
    ✓ run prompt, non-streaming (4 ms)
    ✓ run prompt, streaming (2 ms)
    ✓ run callbacks (1 ms)

 PASS  __tests__/config.test.ts
  Loading an AIConfig
    ✓ loading a basic chatgpt query config (6 ms)
    ✓ loading a prompt chain (4 ms)
    ✓ deserialize and re-serialize a prompt chain (2 ms)
    ✓ serialize a prompt chain with different settings (1 ms)

 PASS  __tests__/parsers/palm-text/palm.test.ts
  PaLM Text ModelParser
    ✓ serializing params to config prompt (4 ms)
    ✓ deserializing params to config (2 ms)
    ✓ run prompt, non-streaming (87 ms)

 PASS  __tests__/testProgramaticallyCreateConfig.ts
  test Get Global Settings
    ✓ Retrieving global setting from AIConfig with 1 model (1 ms)
  ExtractOverrideSettings function
    ✓ Should return initial settings when no global settings are defined
    ✓ Should return an override when initial settings differ from global settings (1 ms)
    ✓ Should return empty override when global settings match initial settings
    ✓ Should return empty override when Global settings defined and initial settings are empty

 PASS  __tests__/testSave.ts
  AIConfigRuntime save()
    ✓ saves the config and checks if the config json doesn't have key filePath (4 ms)

Test Suites: 5 passed, 5 total
Tests:       21 passed, 21 total
Snapshots:   0 total
Time:        2.303 s
Ran all test suites.
✨  Done in 3.58s.

Ran npx ts-node function-call-stream.ts and confirmed correct output metadata with raw_response, e.g.:

      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "kind": "tool_calls",
            "value": [
              {
                "type": "function",
                "function": {
                  "name": "list",
                  "arguments": "{\n\"genre\": \"historical\"\n}"
                }
              }
            ]
          },
          "execution_count": 0,
          "metadata": {
            "finish_reason": "function_call",
            "raw_response": {
              "role": "assistant",
              "content": null,
              "function_call": {
                "name": "list",
                "arguments": "{\n\"genre\": \"historical\"\n}"
              }
            }
          }
        }
      ]

Copy link
Contributor

@rossdanlm rossdanlm left a comment

Choose a reason for hiding this comment

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

All other changes here are just auto-formatted

Ok nice

old

Just to be clear, the rest of the changes were just running the auto-formatter right? Same as Jonathan's command in #613 (comment) ?

@rholinshead
Copy link
Contributor Author

All other changes here are just auto-formatted

Ok nice

old

Just to be clear, the rest of the changes were just running the auto-formatter right? Same as Jonathan's command in #613 (comment) ?

Ya, I have black formatter installed and it auto-formatted these files

@rholinshead rholinshead merged commit 8137a6c into main Dec 29, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants