langchain funcntion call日志

POST /chatgpt/v1/chat/completions

    {
        "functions": [
            {
                "description": "get_word_length(word: str) -> int - Returns the length of a word.",
                "name": "get_word_length",
                "parameters": {
                    "properties": {
                        "word": {
                            "title": "Word",
                            "type": "string"
                        }
                    },
                    "required": [
                        "word"
                    ],
                    "title": "get_word_lengthSchemaSchema",
                    "type": "object"
                }
            }
        ],
        "messages": [
            {
                "content": "You are very powerful assistant, but bad at calculating lengths of words.",
                "role": "system"
            },
            {
                "content": "how many letters in the word educa?",
                "role": "user"
            }
        ],
        "model": "gpt-3.5-turbo",
        "n": 1,
        "stream": false,
        "temperature": 0.0
    }

 << 200 OK 350b

    {
        "choices": [
            {
                "finish_reason": "function_call",
                "index": 0,
                "logprobs": null,
                "message": {
                    "content": null,
                    "function_call": {
                        "arguments": "{\n  \"word\": \"educa\"\n}",
                        "name": "get_word_length"
                    },
                    "role": "assistant"
                }
            }
        ],
        "created": 1702806288,
        "id": "chatcmpl-8WhzUlmR784a0Sqw3BrnNS9bxuewQ",
        "model": "gpt-3.5-turbo-0613",
        "object": "chat.completion",
        "system_fingerprint": null,
        "usage": {
            "completion_tokens": 17,
            "prompt_tokens": 80,
            "total_tokens": 97
        }
    }

POST /chatgpt/v1/chat/completions

    {
        "functions": [
            {
                "description": "get_word_length(word: str) -> int - Returns the length of a word.",
                "name": "get_word_length",
                "parameters": {
                    "properties": {
                        "word": {
                            "title": "Word",
                            "type": "string"
                        }
                    },
                    "required": [
                        "word"
                    ],
                    "title": "get_word_lengthSchemaSchema",
                    "type": "object"
                }
            }
        ],
        "messages": [
            {
                "content": "You are very powerful assistant, but bad at calculating lengths of words.",
                "role": "system"
            },
            {
                "content": "how many letters in the word educa?",
                "role": "user"
            },
            {
                "content": null,
                "function_call": {
                    "arguments": "{\n  \"word\": \"educa\"\n}",
                    "name": "get_word_length"
                },
                "role": "assistant"
            },
            {
                "content": "5",
                "name": "get_word_length",
                "role": "function"
            }
        ],
        "model": "gpt-3.5-turbo",
        "n": 1,
        "stream": false,
        "temperature": 0.0
    }

 << 200 OK 324b

    {
        "choices": [
            {
                "finish_reason": "stop",
                "index": 0,
                "logprobs": null,
                "message": {
                    "content": "There are 5 letters in the word \"educa\".",
                    "role": "assistant"
                }
            }
        ],
        "created": 1702806289,
        "id": "chatcmpl-8WhzVSr2TXgpMvUM6Nq7TQjGMGrTT",
        "model": "gpt-3.5-turbo-0613",
        "object": "chat.completion",
        "system_fingerprint": null,
        "usage": {
            "completion_tokens": 13,
            "prompt_tokens": 107,
            "total_tokens": 120
        }
    }